28.11.2014 Views

System call - Processi, thread

System call - Processi, thread

System call - Processi, thread

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.

Operazioni sui semafori: sem_wait<br />

• wait su un semaforo<br />

int sem_wait(sem_t *sem)<br />

dove:<br />

• sem: individua il semaforo sul quale operare.<br />

e` la wait di Dijkstra:<br />

‣ se il valore del semaforo e` uguale a zero, sospende il<br />

<strong>thread</strong> chiamante nella coda associata al semaforo;<br />

altrimenti ne decrementa il valore.<br />

M-fosset - Sistemi Operativi 2004-2005

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

Saved successfully!

Ooh no, something went wrong!