From owner-freebsd-threads@FreeBSD.ORG Thu Jul 31 23:08:35 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0517537B401 for ; Thu, 31 Jul 2003 23:08:35 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88B2843FB1 for ; Thu, 31 Jul 2003 23:08:34 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003080106083401500kh90de>; Fri, 1 Aug 2003 06:08:34 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id XAA38655; Thu, 31 Jul 2003 23:08:24 -0700 (PDT) Date: Thu, 31 Jul 2003 23:08:24 -0700 (PDT) From: Julian Elischer To: Mike Makonnen In-Reply-To: <20030801054754.GA30332@kokeb.ambesa.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: And problems regarding -lthr (1:1 KSE) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 06:08:35 -0000 On Fri, 1 Aug 2003, Mike Makonnen wrote: > On Fri, Aug 01, 2003 at 12:17:08PM +0900, TeJun Huh wrote: > > I forgot to mention about -lthr (1:1 KSE threading) related problems. > > > > 1. If the program is compiled with '-static -lthr', the program > > crashes at the first thread creation. Stack trace follows. > > Are you using 5.1-RELEASE or -CURRENT ? I think this has already > been fixed in -CURRENT. > > > 2. Without -static, the program works fine, but pthread_create() > > fails with EAGAIN at thread count 110. B.T.W. pthread_create() return > > value handling was wrong in the example program. It always confuses > > me. :-( How can I increase this limit? Again, I'm looking for > > something like ten thousands. > > This is problematic because on i386, libthr uses the LDTs, which > are limited to 9182. But if I'm not mistaken the first NLDT (17) > entries are already in use so in reality you can have only > (9182 - NLDT) threads. You can do this by changing MAXTHR > in src/lib/libthr/arch/i386/i386/_setcurthread.c. You might also > want to bump up UMTX_QUEUES in src/sys/kern/kern_umtx.c if you > do that. > > I am not aware of any limits on alpha or sparc64 (but then I'm > not knowledgeable about either :) > > BTW, libthr uses some of the same code as KSE, but it is not > based on KSE. As Mike says.. libthr and libkse are not the same, though both are derived from the libc_r code. libthr is 1:1 libkse can be compiled to be 1:1 or M:N In M:N mode the 8192 limit does not apply as we multilex a lot of threads to a single LDT entry. > > Cheers. > -- > Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc > mtm@identd.net | D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC 68B9 > mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon! > _______________________________________________ > 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" >