15.06.2013 Views

Dispensa in PDF - Dipartimento di Scienze Ambientali, Informatica e ...

Dispensa in PDF - Dipartimento di Scienze Ambientali, Informatica e ...

Dispensa in PDF - Dipartimento di Scienze Ambientali, Informatica e ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

f<strong>in</strong>e<br />

quanto<br />

ready<br />

runn<strong>in</strong>g<br />

Figura 1.5. Stati dei processi<br />

scheduler<br />

Carnielli Efrem: Programmazione a componenti<br />

wait event<br />

wait<strong>in</strong>g<br />

Programmazione a componenti<br />

deadlock<br />

ternitated<br />

Pensiamo <strong>di</strong> avere ora un sistema multi-thread (figura 1.6): <strong>in</strong> questo caso il<br />

processo web server non commuta contesto ma sarà il thread spawned generato<br />

appositamente per gestire la richiesta giunta dal browser che si blocca <strong>in</strong> attesa<br />

della risposta del DB server; il web server rimane comunque attivo e pronto ad<br />

ricevere altre richieste che saranno affidate ad altri thread. Sarà solo il thread che<br />

ha <strong>in</strong>oltrato la richiesta e solo lui ad essere sospeso, mentre altri thread relativi ad<br />

altre richieste potranno andare <strong>in</strong> esecuzione: avrò una commutazione <strong>di</strong> contesto<br />

tra thread.<br />

12

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

Saved successfully!

Ooh no, something went wrong!