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
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

Explain the Peterson's solution for the critical section problem? In Peterson's solution two variables a) flag and b) turn are used as shared variables. If the both shared vari

Explain Load Balancing Client Server Components When migration functionality from the client - only model to the client - server model, care must be taken not over-or underutil

Define the Sleep (sec) Function Sleep function suspends execution of this process for sec number of seconds. While this function is used in our example for consistency, other f

Explain Busy Waiting Semaphores Weak, Busy-wait Semaphores a) The simplest way to implement semaphores. b) Useful while critical sections last for a short time, or we com

Q. What is the use of system calls? Answer: System calls permit user-level processes to request services of the operating system.

What is an operating system? An operating system is a program that acts as a mediator between a user and the computer hardware. The function of an operating system is to provid

Demand paging gives that pages could only be brought into memory if the running process acts them. This is usually referred to as lazy evaluation as only those pages operated by

Q. Explain the booting process for a Windows XP system? Answer: (1) Since the hardware powers on the BIOS begins executing From ROMand loads as well as executes the bootstrap

Explain about paging? Answer: Paging is a memory-management scheme that permits the physical-address space of process to be noncontiguous. Paging avoids the considerable proble