Questions about preemption and concurrency
Jonathan Neuschäfer
j.neuschaefer at gmx.net
Fri May 27 11:04:01 EDT 2011
On Fri, May 27, 2011 at 05:14:51PM +0530, Naman shekhar Mishra wrote:
> Because the modules run as part of the kernel and no two processes
> can run in the kernel at the same time? Or my question is wrong
> since they CAN run in the kernel at the same time (like when one
> process waits for I/O completion and another is scheduled to run
> which then makes a system call)?
I'm not sure what "run in the kernel" means here, but there can
definetely be more than one process waiting in a system call (e.g.
in a read() on a tty). IIUC, almost any "sleeping" process is.
Processes that wait for disk IO are in "uninterruptible" state which
also allows other processes to run and do system calls.
On SMP systems, where code is really run in parallel, certain resources
and code paths (e.g. ioctl, some file systems), used to be protected by
the Big Kernel Lock, which has just recently been removed.
HTH,
Jonathan Neuschäfer
More information about the Kernelnewbies
mailing list