Parallel Programming WS 2014/2015 - Slide 32b
Objectives:
Understand synchronization of readers and writers
In the lecture:
Explain
- important class of synchronization: shared reading and exclusive writing,
- the readers/writers problem,
- the monitor invariant,
- the design steps,
- different overlapping waiting conditions,
- consequences: several signals in releaseWrite.
Assignments:
- Implement the monitor.
- Implement processes for readers and writers. Delay the processes using sleep with random numbers as parameters. Produce output using the observer module.
- To avoid starvation of writers apply the following strategy: New readers have to wait until no writer is waiting. Introduce a new counter for that purpose. What do you observe?
Questions:
The following problem is similar - but symmetric:
Control bi-directional traffic over a bridge that has only one lane.
Explain the design!
Generiert mit Camelot | Probleme mit Camelot? | Geändert am: 09.10.2014