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 are batch systems?, What are batch systems? Early computers were p...

What are batch systems? Early computers were physically huge machines run from a console. The general input devices were card readers and tape drivers. The common output device

Dynamic memory management, Usually memory is allocated from a large pool of...

Usually memory is allocated from a large pool of unused memory area called the heap. In C++, dynamic allocation/deallocation must be manually performed using commands like malloc,

Networking and distributed systems, Networks and operating systems have a l...

Networks and operating systems have a lot of overlap. In this course, however,we are not going to discuss networking in detail, but rather focus on the networking abstractions prov

What is segmentation?, What is segmentation? In a segmented memory mana...

What is segmentation? In a segmented memory management scheme a programmer views a program to be collection of program components called as segments. Every segment is a logical

Explain demand paging in virtual memory system, Question 1 Explain with di...

Question 1 Explain with diagram all possible states a process visits during the course of its execution Question 2 Discuss Inter-process Communication. What is critical-secti

Managing outside communication, Problem: Managing Outside Communication...

Problem: Managing Outside Communication. a. What is the principal action we use when communicating through a web browser? b. Give an example of how to preaddress an email

Basic server model, Suppose we want to program a Web server; we could easil...

Suppose we want to program a Web server; we could easily do so without using concurrency, as follows: while(true) wait connection read from socket and parse url look up url cont

What is the purpose of system programs, What is the purpose of system progr...

What is the purpose of system programs? System programs can be thought of as bundles of useful system calls. They give basic functionality to users and so users do not require

Multi user systems technology, describe main points of multiuser and multi ...

describe main points of multiuser and multi tasking operating systems.

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