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
What are the different thread levels? There are two broad type of thread implementation: User-Level Threads -- Thread Libraries. Kernel-level Threads -- System Calls.

Medium term scheduling is form of the swapping operation. This attaches to processes that are in a suspended or blocked state. They are swapped out of real-memory storage until t

Question 1: "Three entities must be accountable and responsible for accident prevention." (a) List and explain these three entities. (b) Discuss the role of workers in ma

Semispace works by maintaining two disjoint areas from which memory can be allocated. These areas are called the from-space and the to-space. At ?rst, the algorithm allocates memor

Question: a) What special measures must be taken to ensure the reliability, availability, and security of electronic commerce and digital business process? b) What are the c

What is an acyclic graph? A tree that has been corrupted by links to other branches, but does not have any cyclic paths in it.

Q. Consider a calculating environment where a process is given the privilege of accessing object only n times. Suggest a scheme for implementing this policy. Answer: Add an i

Q. Name two differences between logical and physical addresses? Answer: A logical address doesn't refer to an actual existing address rather it refers to an abstract address in

Explain the steps in deadlock recovery. a)      Exterminate off all processes involved - drastic. b)      Exterminate off one at a time till deadlock gone - select a victim.

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4