01.06.2014 Views

Concurrent Systems II - Bad Request - Trinity College Dublin

Concurrent Systems II - Bad Request - Trinity College Dublin

Concurrent Systems II - Bad Request - Trinity College Dublin

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.

Simplify<br />

Critical Section Problem<br />

integer turn ← 1<br />

loop forever<br />

p<br />

loop forever<br />

q<br />

p1: // non-critical section q1: // non-critical section<br />

p2: await turn = 1 q2: await turn = 2<br />

p3: // critical section q3: // critical section<br />

p4: turn ← 2 q4: turn ← 1<br />

Sections and Protocols are independent of one another, by definition.<br />

If we comment out p3 (or q3), it’s as if we went straight to p4 (resp. q4).<br />

So, we can eliminate p3 (q3). Similarly with p1 (q1).<br />

101<br />

<strong>Trinity</strong> <strong>College</strong> <strong>Dublin</strong><br />

© Mike Brady 2007–2009

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

Saved successfully!

Ooh no, something went wrong!