NVIDIA Interview Question Interns
0of 0 votesIn a multi-threaded process,If one thread is busy on I/O will the entire process be blocked?
Team: System Software
Country: United States
Interview Type: Phone Interview
It WILL be blocked if the thread is implemented as a user level thread and will NOT be blocked if it is implemented as a kernel level thread.
again stupid question.. what means "blocking entire process ?"
process consists of one or more threads. If, for example, a thread which processes the user input is busy on I/O then it would appear to the user that the process is "blocked".
It depends on your program logic if other threads should wait for the thread doing I/O operations at the moment..
"If, for example, a thread which processes the user input is busy on I/O then it would appear to the user that the process is blocked" -- The question is not about how the user "sees" it, but about what happens to the workload assigned to the rest of the threads, do they wait (by virtue of OS or something else) for this thread to finish, or do they carry on with their own business (assuming programmer has allowed them to do so).
The one by M@X above, "depends on which model of threads is used" is the right answer, as far as I know.
if machine is single processor, whole process will be blocked.
if machine is multi processor, whole process may not be blocked .
e.g. thread1 is executing on Processor 1 ( and thread blocked with I/O operation ), thread2 is executing on processor2 . thread1 & thread2 are executing independently so one thread may not block other thread .
@siva.sai.2020 : It has nothing to do with the number of processors. If a thread or a process moves to a blocked state, then some other thread or process which is ready to run will be using the processor. It depends entirely the implementation of the threads, whether it is kernel level, user level or hybrid.

blocking of the entire process happens in ULT(user level thread) where the kernel is unaware about the process being split into two or more threads.
- Anonymous on May 10, 2012 Edit | Flag Reply