17.04.2014 Views

semaphores, classic problems

semaphores, classic problems

semaphores, classic problems

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Semaphores (Dijkstra 1965)<br />

• Slightly more abstract primitives<br />

• A semaphore is a non-negative integer variable<br />

with two atomic operations:<br />

– Passeren (wait): P(s) decrements s by 1 if possible,<br />

otherwise it waits until s becomes positive, then<br />

decrements it.<br />

– Verhogen (signal): V(s) increments s by one.<br />

• The operations are atomic: no other process is<br />

allowed to access the semaphore during a P or V<br />

operation, unless the P operation is blocked.<br />

Computing Systems<br />

http://www.cs.caltech.edu/cs134/cs134a October 10, 2001

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

Saved successfully!

Ooh no, something went wrong!