Re: sched_yield() on 2.6.25
- From: Helge Hafting <helge.hafting@xxxxxxxxxxxxx>
- Date: Mon, 09 Jun 2008 11:03:55 +0200
Jakub Jozwicki wrote:
From the man sched_yield:Having the man page mention the fact that that sched_yield() probably
A process can relinquish the processor voluntarily without blocking by
calling sched_yield(). The process will then be moved to the end of the queue for its static priority and a new process gets to run.
and also IEEE/Open Group:
http://www.opengroup.org/onlinepubs/000095399/functions/sched_yield.html
pthread_mutex_lock(&mutex);
th = pthread_self();
if (pthread_equal(th,last_th)) {
pthread_mutex_unlock(&mutex);
sched_yield();
continue;
Here with SCHED_OTHER sched_yield for the first 100-200 times does nothing.
Should the man be updated?
won't do "what you intend" in the non-realtime cases is probably a good idea;
that way we get fewer application programmers who mistakenly think
that sched_yield can be used for their purposes. And then we'll have
less broken apps.
A pointer to info about what they might want to use instead is even better.
Helge Hafting
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- Re: sched_yield() on 2.6.25
- From: Robert Han***
- Re: sched_yield() on 2.6.25
- From: Jakub Jozwicki
- Re: sched_yield() on 2.6.25
- Prev by Date: Re: Is configfs the right solution for configuration based fs?
- Next by Date: Re: [bug, 2.6.26-rc4/rc5] sporadic bootup crashes in blk_lookup_devt()/prepare_namespace()
- Previous by thread: Re: sched_yield() on 2.6.25
- Next by thread: Re: sched_yield() on 2.6.25
- Index(es):