30.10.2014 Views

Operating Systems - David Vernon

Operating Systems - David Vernon

Operating Systems - David Vernon

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.

Processes<br />

InterProcess Communication IPC<br />

– Mutual Exclusion with Busy Waiting<br />

» Technique 4: Peterson’s Solution (1981)<br />

» processes call routine enter_region before<br />

entering critical region<br />

pass their process number as an argument<br />

if resource is available, enter_region returns having<br />

set a flag to say that process n is now active in its<br />

critical region<br />

otherwise it starts busy waiting until the other<br />

process is no longer active<br />

» processes call routine leave_region after<br />

exiting critical Copyright © 2007 region<br />

<strong>David</strong> <strong>Vernon</strong> (www.vernon.eu)

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

Saved successfully!

Ooh no, something went wrong!