<p><br>
On 7 Oct 2011 16:58, "Parmenides" <<a href="mailto:mobile.parmenides@gmail.com">mobile.parmenides@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> Preemption has two cases: user preemption and kernel preemption. I<br>
> have tow questions about them.<br>
><br>
> 1. According to Love, "If the kernel is returning to user-space, it<br>
> knows it is in a safe quiescent state. In other words, if it is safe<br>
> to continue executing the current task, it is also safe to pick a new<br>
> task to execute." What's the meaning of user preemption's safety? How<br>
> can we deduce safety of schedule from the current task going on?<br>
><br>
> 2. Another statement from Love is that "the kernel can preempt a task<br>
> running in the kernel so long as it does not hold a lock". Why is it<br>
> not safe while kernel code holding lock?<br>
New task pick by scheduler may try to get the same lock resulting in deadlock<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</p>