In Linux, if two threads are created and both of them are running, when one of them calls recv()
or any IO syscall that blocks when no data is available, what would happen to the whole process?
Will the other thread block also? I guess this depends on how threading is implemented. If thread library is in user space and kernel totally unaware of the threads within process, then process is the scheduling entity and thus both threads got blocked.
Further, if the other thread doesn't block because of this, can it then send()
data via the same socket, which is blocking the recv
thread? Duplexing?
Any ideas?