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.

Thread S (2)<br />

• Acquire Mutex M<br />

• Do something<br />

• Unlock Mutex M<br />

•<br />

Signal the condition variable<br />

◾This will awaken a thread<br />

that is waiting on the<br />

condition variable.<br />

pthread_lock(&m)<br />

Do something<br />

pthread_unlock(&m)<br />

pthread_cond_signal(&v)<br />

or<br />

pthread_cond_broadcast(<br />

&v)<br />

65<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!