Re: sched_yield behavior

Nick Piggin
2005-02-27T22:05:08Z

Giovanni Tusa wrote:

> If I am not wrong, the scheduler will choose it again (it will be still the
> higher priority task, and the only of its priority list).
> I have to add an explicit sleep to effectively relinquish the CPU for some
> time, or the scheduler can deal with such a
> situation in another way?

Yes, the scheduler will choose it again. This behaviour is also
specified in the relevant standards.

Your alternatives may be to use other methods of userspace
synchronisation (eg. pipes, semaphores), or to use timers.