Re: [patch, 2.6.11-rc2] sched: RLIMIT_RT_CPU_RATIO feature

From: Ingo Molnar
Date: Thu Feb 03 2005 - 15:53:58 EST



* Con Kolivas <kernel@xxxxxxxxxxx> wrote:

> > * real inter-process handoff. i am thinking of something like
> > sched_yield(), but it would take a TID as the target
> > of the yield. this would avoid all the crap we have to
> > go through to drive the graph of clients with FIFO's and
> > write(2) and poll(2). Futexes might be a usable
> > approximation in 2.6 (we are supporting 2.4, so we can't
> > use them all the time)
>
> yield_to(tid) should not be too hard to implement. Ingo? What do you
> think?

i dont really like it - it's really the wrong interface to use. Futexes
are a much better locking/signalling interface. yield_to() would not be
available in 2.4 either. If the apropriate pthread objects are used then
libpthread will do it more or less optimally on 2.4 too, while on 2.6
they'd be perfectly fine and based on futexes. If 2.4 is not an issue
then a good, futex-based inter-process API is POSIX 1003.1b semaphores
(the sem_init()/sem_*() APIs). But if it should work inter-process on
non-futex kernels too, then only pthread spinlocks will do it.

Ingo
-
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/