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

Several cpu-scheduling algorithms, Q. Several CPU-scheduling algorithms are...

Q. Several CPU-scheduling algorithms are parameterized for instance the RR algorithm requires a parameter to indicate the time slice. Multilevel response queues require parameters

Installation and Training Documentation, Ask question Project Details PROJE...

Ask question Project Details PROJECT OVERVIEW The ABC Hospital is upgrading their version of Windows. As part of the upgrade, 100 new computers will be purchased. Your task is to

Define cpu scheduling, Define CPU scheduling. CPU scheduling is the met...

Define CPU scheduling. CPU scheduling is the method of switching the CPU among several processes. CPU scheduling is the basis of multiprogrammed operating systems. By switching

What is single-level directory, What is Single-level Directory All file...

What is Single-level Directory All files are constrained in the similar directory, which is simple to support and understood. One limitation is when the number of files enhance

Implementation of modern memory management system , Central to implementati...

Central to implementation of a modern memory management system is the page replacement algorithm. Modern virtual memory systems break memory up into pages and map (via a page table

Utility programs, Utility Programs: those programs which are not the essen...

Utility Programs: those programs which are not the essential part of operating system. But they provide different utilities / features to the users e.g. MS-DOS : Fdisk, FORMAT, AT

necessary conditions for a deadlock , Q) a. Given that the first three nec...

Q) a. Given that the first three necessary conditions for a deadlock are in place, comment on the feasibility of the following strategy. All processes are given  unique priorities.

Determine the fork and execlp functions - linux, Assignment What I...

Assignment What I'm covering: General control flow fork() execlp() Parameters Makefiles Additional Questions General Control Flow/fork(

Define an assembly language, Define an assembly language  Assembly lan...

Define an assembly language  Assembly language stands for a Low level programming language

Ipc, explain in detail about ipc in linux

explain in detail about ipc in linux

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