Question: Operating Systems: Consider (again) the Readers-Writers solution using semaphores given in the lecture notes (09-Semaphores, Slide 11). No readers and no writers are currently in
Operating Systems:
Consider (again) the Readers-Writers solution using semaphores given in the lecture notes (09-Semaphores, Slide 11). No readers and no writers are currently in the database. For the following sequence of events, describes what happens. That is, state where each process will block (if it blocks). Describe any processes released as a result of an event and where they each then go.
a.) Writer 1 arrives
b.) Reader 1 arrives
c.) Reader 2 arrives
d.) Writer 2 arrives
e.) Reader 3 arrives
f.) Writer 1 leaves
g.) Reader 4 arrives
h.) Current occupant of the database leaves. If more than one process was in the database, assume all of them leave at this point. What happens now?
i.) Writer 3 arrives and Reader 5 arrives in that order. Then what happens? That is, describe the sequence of events until all Readers and Writers have finished and have left. (No new Readers or Writers arrive.)

Reador Processos Writor Procossos P Mutox )i if ( (Activewriters == 0) && P Mutox )i (WaitingWriters 0))t (ActiveReaders == 0) && (WaitingWriters - 0)) t ActiveReaders++ ActiveWriters++ else WaitingReaders++ else V( Mutex ); WaitingWriters++ V( Mutex )i P( OKToRead);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
