Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Nov 2010 10:55:28 -0700
From:      Julian Elischer <julian@freebsd.org>
To:        David Xu <davidxu@freebsd.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: Thread ID is reused too quickly
Message-ID:  <4CD05090.4070404@freebsd.org>
In-Reply-To: <4CD03E75.1050302@freebsd.org>
References:  <4CD03E75.1050302@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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
>
> Regards,
> David Xu
> _______________________________________________
> freebsd-threads@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to 
> "freebsd-threads-unsubscribe@freebsd.org"
>




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