Concurrency Control 63
at any given time since a chopstick can be held by only one philoso-
pher at a time. Design a synchronization protocol so these poor hungry
philosophers can eat. Use the synchronization constructs described in
this chapter. Discuss your solution in terms of deadlock, fairness and
starvation.
4. OpenMP lacks any pair-wise high-level synchronization constructs since
they violate the goal of maintaining consistent semantics with a serial
execution of the OpenMP program. Using the flush construct (described
in Appendix A) implement a semaphore to be used by a pair of OpenMP
threads.
5. Using locks, design a FIFO queue that works with a single writer and a
single reader.
6. Assume a system that supports atomic reads and writes of words ...