views:

29

answers:

1

Hello

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 pointer?

A: 

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.

Andy Grover
It is no data for read. Task will sleep. I ask, will the kernel `current` pointer (kernel stack) point to this task.
osgx