And problems regarding -lthr (1:1 KSE)

TeJun Huh tj at atj.dyndns.org
Fri Aug 1 00:18:16 PDT 2003


On Fri, Aug 01, 2003 at 02:56:42AM -0400, Daniel Eischen wrote:
> 
> You can create thousands with libkse.  You'll really
> only be limited by memory -- unless you create a lot
> of threads as PTHREAD_SCOPE_SYSTEM, in which case you'll
> likely have similar limitations as libthr.  As julian
> said, libkse can be compiled to be in 1:1 mode, so if
> you build it that way (the default is M:N, not 1:1),
> you'll also be limited.
> 
> Dan Eischen

 Yes, I tried that.  Currently, what I wanna know are

 1. How to increase the number of threads upto ~9000 using 1:1
threading.  It doesn't matter whether I use libkse or libthr.  I'm
gonna try recompile libthr with MAXTHR, UMTX_QUEUES adjusted.  If that
works, this problem is solved.  (Although still limited to ~9000)

 2. On M:N KSE, how to put more KSEs into one process or KSE group.
>From what I understand, a KSE multiplexes userthreads, but when the
user thread invokes a blocking systemcall, the KSE blocks handling it
and another KSE does an upcall to user level scheduler notifying the
blocking and the user level scheduler can utilize the upcalling KSE to
run another user thread, thus maintaining concurrency.  (Am I getting
it right?)

 So, with large number of threads blocked, large number of KSEs are
needed and, from what I've read, the hard limit will be ~9000 because
KSEs shouldn't be very different from kernel threads from this
perspective.  But what I get is something around 150 and wanna know if
there is any sysctl or boot kernel parameter or anything that can be
tuned to increase this limit.

 3. Lastly, about the kernel hang problem.  Is it a known bug or fixed
in 5.1-CURRENT?  If not, I think this is a very serious problem, because
any user can hang the whole system very hard.

 Thanks in advance.


More information about the freebsd-threads mailing list