Docsity

Operating Systems: Bounded Buffer, Read-Writer, and Dining Philosopher Algorithms, Study notes of Operating Systems

Partial preview of the text

Download Operating Systems: Bounded Buffer, Read-Writer, and Dining Philosopher Algorithms and more Study notes Operating Systems in PDF only on Docsity!

CSE 430: Operating Systems

Class:

Date:

Spring 2009

Reader-Writer (CORRECT)ReadEntry()if not (wc=0 and wwc=0) {

rwc++; read.wait; rwc--;

} rc++;read.signal;ReadExit()rc--; if rc=0 then write.signalWriteEntry()if not (rc=0 and wc=0) {

wwc++; write.wait; wwc-- } wc++;WriteExit()wc--;if rwc>0 the read.signal else write.signal