03.05.2013 Views

Concurrency en race condities

Concurrency en race condities

Concurrency en race condities

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

E<strong>en</strong> te fijnmazige afscherming<br />

• Bij elke gedeelde variabele e<strong>en</strong> semafoor:<br />

– Gebruik b.v. (A <strong>en</strong> B gedeeld)<br />

P(sem_A);<br />

temp = A;<br />

P(sem_B);<br />

A = B;<br />

V(sem_A);<br />

B = temp;<br />

V(sem_B);<br />

– Bewerkelijk; kans op deadlock<br />

• Het beste: e<strong>en</strong> semafoor voor e<strong>en</strong> bij elkaar<br />

hor<strong>en</strong>de groep variabel<strong>en</strong>.<br />

College OS 2010 – 2011 28

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

Saved successfully!

Ooh no, something went wrong!