Solve a generalized dining philosopher problem, Operating System

In this project, you will implement the Chandy and Misra's (CM) algorithm using POSIX Threads (Pthreads).   The algorithm  is a distributed algorithm to solve a generalized dining philosopher problem, or a general resource sharing with arbitrary agents.  For a detail description of the algorithm, refer the last page.  

To solve a generalized dining philosopher problem, we have to specify a mutual exclusion graph using a  simple text file consisting of two  commands: node and edge.   For example, the graph at the last page can be described by the following text file.  A "node" command has three

(3) parameters: node name, an average thinking time, and an average eating time.  An  "edge"  command has two node names.  The first node will have  a fork and the second node will have a token initially.  

You will create a thread for each node. The nodes communicate to each other to exchange tokens and forks. To properly handle synchronization issue for shared variables if any, semaphore and/or mutex supported by pthread must be utilized.  But, try to use such shared variables as little as you can.  Note that you can scale down the time for fast simulation, but nodes (or threads) will think and eat at the real time of the possibly scaled-down clock.    

While  threads are running,  they will collect logging data so that  they can statistically analyze the actual timely behavior of the threads, and their overall statistical characteristics.  Be creative to determine what statistical data to be shown in the project report.  

The above graph is just an example. In the actual simulation run, create several  connected graphs with different number of nodes, different edge density, and different average times and compare their statistical behavior.

Posted Date: 3/12/2013 2:36:36 AM | Location : United States







Related Discussions:- Solve a generalized dining philosopher problem, Assignment Help, Ask Question on Solve a generalized dining philosopher problem, Get Answer, Expert's Help, Solve a generalized dining philosopher problem Discussions

Write discussion on Solve a generalized dining philosopher problem
Your posts are moderated
Related Questions
Explain the Statements Present in Assembly Language An assembly program consists of subsequent three types of statements: a. Imperative statements: this point out an action

Develop a user mode command interpreter which support these functions: "list-short" -- just like ls without any options "list-long" -- same as ls -l "change" -- same as cd Your co


What are the disadvantages of swapping technique used in pre-3BSD UNIX systems? If there is excessively much memory contention, processes are swapped out until sufficient

Safety algorithm : This is to make sure if the system is in safe state or not. It may need an order of m x n2 operation to determine if the state of the system is safe or not.

What are a safe state and an unsafe state? Answer:  A state is safe if the system can allocate resources to every process in some order and still avoid a deadlock. A system is

what is the function of operation management?

Interval among the time of submission and completion of the job is known as                    Interval among the time of submission and completion of the job is known as Turn

Explain about disk scheduling with neat diagram? FCFS Scheduling SCAN scheduling C-SCAN scheduling SSTF scheduling LOOK Scheduling

File structure Certain files must conform to a needed structure that is understood by the operating system. The operating system may consist that an executable file has a parti