Write a program to synchronize the agent, Operating System

The Cigarette-Smokers difficulty Consider a system with three smoker processes and one agent process. Every smoker continuously rolls a cigarette and then smokes it. But to roll as well as smoke a cigarette the smoker needs three ingredients: paper, tobacco and matches. One of the smoker progression has paper another has tobacco and the third has matches. The agent has an endless supply of all three materials. The agent put two of the ingredients on the table. The smoker who has the residual ingredient then makes and smokes a cigarette signalling the agent on completion. The agent then places out another two of the three ingredients and the cycle repeats. Write a program to synchronize the agent as well as the smokers using Java synchronization.

 

Posted Date: 7/27/2013 2:46:29 AM | Location : United States







Related Discussions:- Write a program to synchronize the agent, Assignment Help, Ask Question on Write a program to synchronize the agent, Get Answer, Expert's Help, Write a program to synchronize the agent Discussions

Write discussion on Write a program to synchronize the agent
Your posts are moderated
Related Questions
Difference between threads and processes 1. Thread is flow of implementation. Process is group of instruction which is alike to that of a program except which may be stopped an

Deadlock Prevention Prevention is the name given to method that guarantee that deadlocks can never happen for the reason that the way the system is structured. Since 4 conditio

what do you mean by starvation?explain in detail

What are the objectives and functions of operating system? Functions of operating systems 1.      It allocates the resources and acts as a supervisor. 2.      It hides th


what are reasons for cooperating processes

Define race condition. When various process access and manipulate similar data concurrently, then the outcome of the execution depends on certain order in which the access take



Q. Could you replicate a multilevel directory structure with a single-level directory structure in which arbitrarily long names can be used? If your answer is yes describe how you