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

Create successful ePaper yourself

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

From Thread U’s POV (2)<br />

• If C is false, wait for condition variable V to be signalled.<br />

• This is tricky, as access to V is controlled by M.<br />

◾So, Mutex M is unlocked,<br />

◾Thread sleeps, to be woken when V is signalled,<br />

◾Then, M is re-acquired.<br />

• No guarantee you’ll get it right away–maybe another thread will.<br />

• So now, if V has been signalled…<br />

61<br />

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

© Mike Brady 2007

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

Saved successfully!

Ooh no, something went wrong!