the cigarette-smokers difficulty consider a


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.

 

Request for Solution File

Ask an Expert for Answer!!
Operating System: the cigarette-smokers difficulty consider a
Reference No:- TGS0327152

Expected delivery within 24 Hours