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 how indefinite blocking or starvation occurs..

Define Middleware to Ease the Low-Level Protocol Burden Fortunately, many products are available today to ease the low-level protocol burden on the application programmer. Midd

Q. The accelerating search for described in subsequent exercise is typical of hard-disk drives. By contrast floppy disks and several hard disks manufactured before the mid-1980s t

FIXED PARTITIONING Using fixed partitioning we are able to allocate the memory Here we are dividing the memory into a few fixed partitions.Every partition may not be of the si

Question 1 Discuss the following with respect to Operating Systems: Operating System Components Operating System Services Question 2 Describe the theory behind Pagin


Explain the Sleep (ms) Function  This call places the current thread in a suspended state for the number of milliseconds passed as the parameter (ms). After that Windows NT wil

What is a reference string? An algorithm is evaluated by running it on a particular string of memory references and computing the number of page faults. The string of memory re

Q. Presume that you have coded the deadlock-avoidance safety algorithm as well as now have been asked to implement the deadlock-detection algorithm. Can you do thus by simply usin

Explain Deadlock Prevention-Resource allocation graph allocation Resource allocation graph algorithm :  Using this algorithm we are able to actually know if there exists in th