:So I was wondering if we even have to try to avoid reuse of tids. I don't
think so, because they are not user visible. So why don't we just use a simple
array to store the pointers? Granted, that's going to waste memory if you
first spawn 100000 threads and then close all but one. But apart from that, it
would be O(1) and *very* easy to use/understand. Tid allocation and thread
creation could even be lock-free (two atomic instructions, though, so maybe no
gain).
:
:If we need to try to avoid reusing tids (like we should for pids), there is
this cool O(1) pid allocator from NetBSD, using some fancy array with special
data handling.
:
:cheers
: simon
I'm a bit confused. TIDs are (and have to be) user visible. After all,
how else do you signal a LWP?
-Matt