Suppose there is no kernel level support for threads. A process has 10 threads running and one of them requests I/O.
Does the phread library declares the I/O request to the kernel right away or starts executing threads in it's ready queue?
(If it declares it's I/O request then it will be preempted from the CPU, hence rendering multi-threading useless for I/O intensive tasks).
First, i think although there are 10 threads "running", in fact only one of them is active each time. And context switch happens in order to create this concurrent running illusion.
Therefore, only the actual running thread can issue i/o request to the kernel. If it is blocking I/O, yes, the whole system is waiting for the i/o response. If it is non-blocking i/o, kernel will switch to next ready thread and continue execution.Only when the I/o has finished, interrupt is generated to inform kernel that the previous thread can be put back into ready queue again.
But I/O intensive task is indeed slow.