When is to preempt safe?

Jonathan Neuschäfer j.neuschaefer at gmx.net
Fri Oct 7 12:44:17 EDT 2011


On Fri, Oct 07, 2011 at 07:27:12PM +0800, Parmenides wrote:
> 2. Another statement from Love is that "the kernel can preempt a task
> running in the kernel so long as it does not hold a lock". Why is it
> not safe while kernel code holding lock?

If you preempt while a lock is being held, another task could try to
acquire the same lock, causing a deadlock.

HTH,
	Jonathan Neuschäfer



More information about the Kernelnewbies mailing list