









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










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