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.)
-hpa
-- PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD 1E DF FE 69 EE 35 BD 74 See http://www.zytor.com/~hpa/ for web page and full PGP public key Always looking for a few good BOsFH. ** Linux - the OS of global cooperation I am Baha'i -- ask me about it or see http://www.bahai.org/