"maxthr" state

David Xu davidxu at freebsd.org
Tue Jan 27 18:13:17 PST 2004


Daniel Eischen wrote:
> On Tue, 27 Jan 2004, Julian Elischer wrote:
>>
>>We are limitted by hardware to 8191 kernel threads on x86
>>but that could be a LOT of user threads..
> 
> 
> Using libkse, you are limited to 8191 KSEs, not threads.
> You can have as many threads for which you have the (other)
> resources :)
> 
> 
System scope threads can only have 8191 threads or less, this because
current implementing in libkse and libthr use LDT entry for TLS, if we
defined a fixed entry in GDT, and introduce a syscall allow userland
to set TLS, and remember it in kernel, in kernel context switch routine,
we can load the TLS into the fixed GDT entry, and userland only has one
GDT entry for all system scope threads, for example, we use %gs as TLS
register, and all thread will have same %gs, in this way, we no longer
have 8191 threads limit.

David Xu




More information about the freebsd-threads mailing list