When is to preempt safe?

Parmenides mobile.parmenides at gmail.com
Sun Oct 9 07:52:34 EDT 2011


2011/10/9 Daniel Baluta <daniel.baluta at gmail.com>:
> On Sat, Oct 8, 2011 at 7:19 PM, Parmenides <mobile.parmenides at gmail.com> wrote:
>
> Well, I think that if task B has higher priority than task A, then A would
> never have the chance to release the lock.
>

Hmm...!  Does that mean lower priority tasks never have chances to run
when a highest priority task is running? AFAIK, for the old O(1)
scheduler, even with higher priority, B eventually will be put into
expire array when it using up its timeslice. That cause A has chance
to run again. As far as the newer CFS scheduler is concerned,  when
B's virtual clock is go ahead prior to A, the the scheduler might also
select A to run again. So, I think A can release the spin lock
eventually.



More information about the Kernelnewbies mailing list