Reader-writer policies and dining philosophers
Trace reader-writer admission under three policies and break a circle of fork waits, then separate deadlock from starvation. Threads and concurrency contracts · Operating systems.
R1 and R2 are reading, a writer waits, and R3 arrives. Letting R3 in is quick, but the writer may never get its turn. Is that the same kind of stuck as three philosophers holding one fork each?
What you will learn
- Trace reader preference, writer preference and arrival order on the same requests
- Show how a circle of fork waits arises and how a fork order breaks it
- Say why a deadlock fix does not remove starvation
Lesson outline
- Readers share, a writer is alone
- Three policies on one set of requests
- Three philosophers and a circle of waits
- A fork order that breaks the circle
- Deadlock against starvation
17 minutes · 4 scenes · 0 predict checks · 12 quiz questions
The full lesson is available with Premium.