Reputation: 6729
Does Linux scheduler hand of control flow to a different process while current one is waiting on select(), poll() or other socket operations in synchronous (blocking) mode? What is the status of process while it's waiting? How exactly is it waken up?
there is a version that process is in a 'sleeping' state, it's waken up by kernel wakeup with WCHAN, and yes, the operating system will schedule other processes to run while one is blocked on IO. is that variant correct? Do you know what should / can I read these things up?
Upvotes: 2
Views: 767
Reputation: 23266
Yes it does. Usually when a process executes the system call it voluntarily calls schedule and waits on the pages in memory (which are going to be read in the I/O). In the I/O completion handler it releases the locks on this page which remove the waiting process from the wait queue and place them back onto the run queue where they can continue to execute. I think that operating systems books should cover it if you're willing to read into it but I would just look at the code :)
Upvotes: 1