Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Nov 2010 09:32:45 +0000
From:      David Xu <davidxu@freebsd.org>
To:        Julian Elischer <julian@freebsd.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: Thread ID is reused too quickly
Message-ID:  <4CD12C3D.3010104@freebsd.org>
In-Reply-To: <4CD05090.4070404@freebsd.org>
References:  <4CD03E75.1050302@freebsd.org> <4CD05090.4070404@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.  :-)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CD12C3D.3010104>