Thread ID is reused too quickly
David Xu
davidxu at freebsd.org
Wed Nov 3 01:32:43 UTC 2010
Julian Elischer wrote:
> On 11/2/10 9:38 AM, David Xu wrote:
>> Our kernel thread ID is reused too quickly, is there any way to fix it ?
>
> we could free them into a holding pool, (an array set up as a ring buffer)
> with (say) several hundred slots..
> until the pool fills up we don't actually give any thread-IDs back and
> when it fills
> up we put the ID we are removing into the head of the queue and give
> back the
> one that is at the other end of the queue.
>
> I think it would be very easy to implement.. you might even have a
> per-cpu version
> if you didn't want a lock or maybe there is a lock already in use we can
> hide it under.
>
>
> Julian
Yes, we use the ring buffer in thread library to delay a thread
structure to be reused too quickly, I agree that kernel can do the same
thing. :-)
More information about the freebsd-threads
mailing list