Re: Killing clones

Albert D. Cahalan (acahalan@cs.uml.edu)
Fri, 15 Aug 1997 00:45:40 -0400 (EDT)


H. Peter Anvin writes:

> Note: there is actually no need for tid's to be allocated from a
> larger pool than pid's, although that may possibly allow some
> optimizations (I am not 100% convinced, since I think the kernel
> would have to validate all assumptions explicitly.)
>
> You could very well allocate them out of the same number pool;
> if you do *not* specify CLONE_PID then you allocate both a pid
> and a tid, if you do, then you allocate a tid only. That would
> mean that tid's wouldn't "look" any different than pid's, but
> the kernel would still know.
>
> For example: process - 47 threads - 48, 57, 122
> process - 90 threads - 91, 94, 102, 107, 121
> process - 92 threads - 93
>
> (The last process being single-threaded.)

That solves a concern I had: /proc could run out of inode numbers.
It also avoids dealing with signed/unsigned 16/32 bit troubles.
How well would the thread APIs tolerate this?