6-exr - 6 C H A P T E R Process Synchronization Practice...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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

Page1 / 2

6-exr - 6 C H A P T E R Process Synchronization Practice...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online