Problem Set Number 6
Computer Science 111

Due by 5 PM, Friday March 24, 2000

1. From the text: Chaper 5 problem 17 (p. 229)

2. Chapter 5 problem 18, part d only (p. 229)

3. Chapter 6 (not 5) problem 22 (pp. 286-7)

4. Suppose two processes A and B both need some nonshareable resource for short periods of time. Each process may acquire the resource, use it, release it, and then request it again sometime later. Suppose the operating system controls access to the resource with a flag. If the flag is 0, process A's request can be granted but process B must wait. If the flag is 1, process B's request can be granted but A must wait. Each time A finishes with the resource, the flag is changed to 1; each time B finishes, the flag is changed to 0. Describe any drawbacks you see with this scheme.