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

FUNDAMENTAL OF OS, WHAT IS OPERATING SYSTEM ?ENLIST AND EXPLAIN BASIC SERVI...

WHAT IS OPERATING SYSTEM ?ENLIST AND EXPLAIN BASIC SERVICES PROVIDE BY OS

Ipc, Explain in detail about ipc in linux

Explain in detail about ipc in linux

Cycle time, when demand is 24000 units/year, production rate is 48000 units...

when demand is 24000 units/year, production rate is 48000 units/year, setup cost is rs 200 per setup, carring cost is rs 20 per units/year, and economic batch quantity is 692.8203

What happens when you execute a program in unix, When you run a program on ...

When you run a program on your UNIX system, the system prepares a special environment for that program. This environment owns everything needed for the system to execute the progra

What is real time system, What is real time system? A real time system ...

What is real time system? A real time system has well explained, fixed time constraints. Processing must be done within the explained constraints, or the system will fail. It i

What is an acyclic graph, What is an acyclic graph? A tree that has bee...

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.

Deadlock resoloution technique, justify the role played by the operating sy...

justify the role played by the operating system in managing the process to avoid deadlock

Explain the demand paging system, Question : (a) In the demand paging ...

Question : (a) In the demand paging system, when a process tries to access a page that was not brought into memory, a page fault occurs that involves a series of actions. The

Thread, advantages and disadvantages of kernal level thread

advantages and disadvantages of kernal level thread

Explain optimal page replacement, Optimal page replacement An optimal ...

Optimal page replacement An optimal page replacement algorithm has the least page fault rate of all algorithms. The algorithm states that a 'replace the page that will not be

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