Blocking syscalls with no other load in system (linux kernel)
If there is only 1 running application in the system (and default 100 sleeping process), and it do a blocking syscall (I'm interested in blocking recv or blocking read). Will linux kernel delete this application from task_t *current开发者_JS百科
pointer?
You're asking will the running application sleep?
If there is data to satisfy the read, then it will not sleep -- the kernel will copy the queued data into your buffer and return from the syscall. If there is no waiting data, then the process will sleep. This does not depend on the state of other processes on the system. If all the processes are sleeping, the kernel will do useful things like putting the CPU into a lower-power state, until an interrupt occurs, which might possibly mean that the data your process was waiting for may now be available.
精彩评论