28.11.2014 Views

System call - Processi, thread

System call - Processi, thread

System call - Processi, thread

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Esempio: produttore e consumatore<br />

#include <br />

#include <br />

#define BUFFER_SIZE 16<br />

typedef struct<br />

{<br />

int buffer[BUFFER_SIZE];<br />

p<strong>thread</strong>_mutex_t lock;<br />

int readpos, writepos;<br />

int cont;<br />

p<strong>thread</strong>_cond_t notempty;<br />

p<strong>thread</strong>_cond_t notfull;<br />

}prodcons;<br />

M-fosset - Sistemi Operativi 2004-2005

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

Saved successfully!

Ooh no, something went wrong!