This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 6 C H A P T E R Process Synchronization Practice Exercises 6.1 In Section 6.4 we mentioned that disabling interrupts frequently could affect the system’s clock. Explain why it could and how such effects could be minimized. 6.2 The Cigarette-Smokers Problem . Consider a system with three smoker pro- cesses and one agent process. Each smoker continuously rolls a cigarette and then smokes it. But to roll and smoke a cigarette, the smoker needs three ingredients: tobacco, paper, and matches. One of the smoker pro- cesses has paper, another has tobacco, and the third has matches. The agent has an infinite supply of all three materials. The agent places two of the ingredients on the table. The smoker who has the remaining ingredient then makes and smokes a cigarette, signaling the agent on completion. The agent then puts out another two of the three ingredi- ents, and the cycle repeats. Write a program to synchronize the agent and the smokers using Java synchronization....
View Full Document
- Winter '09
- Operating Systems, Cigarette, Windows XP, Affect