03.05.2013 Views

Concurrency en race condities

Concurrency en race condities

Concurrency en race condities

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Tell<strong>en</strong>de semafoor - e<strong>en</strong> toepassing<br />

• Ringbuffer<br />

• Produc<strong>en</strong>t vraagt e<strong>en</strong> leeg<br />

vakje <strong>en</strong> maakt dat vol<br />

Producer() {<br />

while (1) {<br />

produce();<br />

empty.P();<br />

fill_buffer();<br />

full.V();<br />

}<br />

}<br />

• Werkt dit ook bij 4<br />

produc<strong>en</strong>t<strong>en</strong>?<br />

Produc<strong>en</strong>t<br />

L<br />

L<br />

College OS 2010 – 2011 30<br />

L<br />

L<br />

V<br />

L V<br />

V<br />

V<br />

Consum<strong>en</strong>t

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

Saved successfully!

Ooh no, something went wrong!