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

Cpu scheduling alogarithm program in javascript, a program that can do cpu ...

a program that can do cpu scheduling algorithm priority using javascript or php to display gaant chart and calculate waiting and average waiting time

What are conditions under which a deadlock situation arise, What are condit...

What are conditions under which a deadlock situation may arise? A deadlock situation can arise if the following four conditions hold simultaneously in a system: a. Mutual ex

Developing code with threads, Developing Code with Threads Writing code...

Developing Code with Threads Writing code to support a thread-based implementation is very straightforward. Simple APIs are presented to the developer for each threads package.

Explain how a domain user account is authenticated, Question: a) The fo...

Question: a) The following questions pertain to User and Group accounts in Windows XP: i) Give four differences between a Power User and a Guest User account. ii) Explain h

What is degree of multiprogramming?, What is degree of multiprogramming ? ...

What is degree of multiprogramming ? Degree of multiprogramming signifies the number of processes in memory. If the degree of Multiprogramming is steady after that the average

Write a script in linux to match a data directory, Write a script that uses...

Write a script that uses this idea to print output similar to the following: Files in this directory that match *~ : bash-scripts.html~ chimpanzee~ countdown~ countd

Operating System, my Operating System is windows trust but when the windows...

my Operating System is windows trust but when the windows start say its windows xp. help pleaes

Explain the file-system manipulation, Q. Explain the File-system manipulati...

Q. Explain the File-system manipulation? File-system manipulation there is several details in file allocation, creation, deletion and naming that users should not have to perfo

Explain peterson''s solution for the critical section problem, Explain the ...

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

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