From owner-freebsd-threads@FreeBSD.ORG Tue Jan 27 18:13:17 2004 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 9FA8616A4CE for ; Tue, 27 Jan 2004 18:13:17 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC00D43D39; Tue, 27 Jan 2004 18:13:06 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) i0S2CeFR070514; Tue, 27 Jan 2004 18:12:41 -0800 (PST) (envelope-from davidxu@freebsd.org) Message-ID: <40171A1A.1070003@freebsd.org> Date: Wed, 28 Jan 2004 10:10:34 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031208 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: "maxthr" state 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: Wed, 28 Jan 2004 02:13:17 -0000 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