13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Mechanisms 277urgent queue34entryqueueguard2 1procedures5678condition queuesFigure 8.3 Monitors with conditionsurgent queue (shown at the top of the monitor). As before, we insist that at most oneactivity inhabit the guard procedures (the center of the monitor) at any time. Activitiesthat are blocked will be placed in these queues. Here are the rules that govern the doorsin and out of the queues and the central region:(1) New activities wait in the entry queue. A new activity may enter through door 2if no activity is currently in the central region.(2) If an activity leaves the central region through door 1 (the exit), one activity isallowed in through door 4 (from the urgent queue) if there is one waiting there.If not, one activity is allowed through door 2 (from the entry queue) if there isone waiting there.(3) <strong>An</strong> activity that executes a wait enters the door to the appropriate conditionqueue (for example, 5 or 7).(4) When an activity executes signal, the signaled condition queue is inspected. Ifsome activity is waiting in that queue, the signaler enters the urgent queue (door3) and one waiter is allowed into the central region (door 6 or 8). If no activity iswaiting in that queue, the signaler proceeds without leaving the central region.The signal is ignored.(5) All queues are ordered first in, first out.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!