Solve a generalized dining philosopher problem, Operating System

Assignment Help:

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.


Related Discussions:- Solve a generalized dining philosopher problem

What is a file, Question 1 What is a file? Write down the operations on fi...

Question 1 What is a file? Write down the operations on files Question 2 What do you mean virtual machine? Write down the application of virtual machine Question 3 What

Explain a boot control block, Explain a boot control block A boot contr...

Explain a boot control block A boot control block can have the information required by the system to boot an operating from that partition. If the disk does not have an operati

Operating system.., What is the use of FIFOs in client-server applications

What is the use of FIFOs in client-server applications

Unix, UNIX Shell and History feature. 1.Creating a child process. 2.Creatin...

UNIX Shell and History feature. 1.Creating a child process. 2.Creating a history feature. Its exactly "programming project 1 - Unix Shell and History Feature (p.157-159)" in the Si

Explain logical file system architecture, Logical File System Responsi...

Logical File System Responsible for providing the before discussed interface to the user including: File access. Directory operations. Security and protection.

Any four types of operating system feature and structure, explain any four...

explain any four types of operating system feature and structure(design)

Define file permission in unix, The permission function is used to calculat...

The permission function is used to calculate what, if any access each class or level of user has to each file on a Unix machine. The permission task is one of the data components s

Unix , A friend has promised to log in at a particular time. However, he ne...

A friend has promised to log in at a particular time. However, he needs to be contacted as soon as he logs in. The shell script checks after every minute whether he has logged in o

What are the five major activities of an operating system, What are the fiv...

What are the five major activities of an operating system in regard to process management? The creation and deletion of both user and system processes The suspension and res

What is an i/o subsystem?, What is an I/O subsystem? The control of dev...

What is an I/O subsystem? The control of devices connected to the computer is a main issue while designing operating systems. Since I/O devices differ widely in their function

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd