Hi. If a linux process issues a blocking command like reading from a socket, which blocks indefinitely, can a context switch still occur while the command is waiting? In other words, is just THAT process blocked, or are all processes blocked?
I want to make a network messaging program that, after making a connection, forks into to 2 parts: one to read messages from the other side and one to fget input from the keyboard and send it. The problem is, both recv and fgets block, so once either process got the CPU, it would not give the other one a turn until recv() or fgets() returned (if these indeed block all processes). The result would be that the processes would take turns, and there would be virtually no concurrent execution at all, which defeats the purpose of using processes. The users would have to take turns sending messages back and forth, which is not what I want.
Thanks in advance.