Re: [PATCH] POSIX timers for 2.4.1

Linus Torvalds (torvalds@transmeta.com)
Sat, 3 Feb 2001 09:47:44 -0800 (PST)


On Sat, 3 Feb 2001, Jamie Lokier wrote:

> Robert H. de Vries wrote:
> > Hi Linus,
> > c. setitimer() can be used only once in a given process, you can have
> > up to 32 (configurable) POSIX timers at the same time in your process.
>
> Why is there a limit? With such a small limit, any library that wants
> to use its own private timers is going to have to agree a way to
> multiplex with other libraries, and you're back to setitimer().

There's a limit, simply because the thing is implemented as an array. Ugh.

It also doesn't handle the old itimers with the new ones, so you end up
having _both_ the three hardcoded timers _and_ the new timers. Which I
think is rather ugly.

Quite frankly, I'd much rather have the current real/prof/virt itimers
expanded to lists instead (ie _three_ lists: the behaviour of
real/prof/virt timers are very different, and trying to mix them on one
list would be horrible), with the magic timer ID value of zero being the
one that the old itimer() functions work on.

That way, CLONE_ITIMERS would also do something sane (which it doesn't do
with the current POSIX timer patch - it will clone the posix itimers but
not the old itimers).

Also note that the POSIX itimer patch with CLONE_ITIMERS seems to be
horribly buggy: it will save off "timer->it_process", but the process may
not actually EXIST any more by the time the timer is called: exiting only
decrements the usage count, which may be elevated due to clone's etc.

In short, there's not a way in hell I will apply this patch any time soon.
It has real implementation bugs that will cause oopses and
possible lockups (sending signals to non-existent tasks), and I think it
has design problems too.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/