operating system - If one thread is busy on I/O will the entire process be blocked -


in multi-threaded process,if 1 thread busy on i/o entire process blocked?

afaik, totally depends on programmer how manage threads inside programs. if thread there no i/o, processor never sit idle & start executing thread. however, process in split threads such 1 thread waits result of other, the entire process blocked.

please comment if more information needs added. there exist other explaination?

if process has 1 thread, yes.

if process has multiple threads, no if operating system supports multithreading.

this question can addressed in terms of underlying implementation of user threads. there different models multihreading models, in order implement user threads have mapped kernel thread:

  • many-to-one: many user threads 1 kernel thread

  • one-to-one: each user thread assigned kernel thread.

  • many-to-many: many user threads split on different kernel threads.

in many-to-one case, single block-operation (system call) within thread can block whole process. disadvantage not present in one-to-one model.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -