From owner-freebsd-threads@FreeBSD.ORG Fri Jul 18 16:52:55 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 534D937B401; Fri, 18 Jul 2003 16:52:55 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE4AC43FA3; Fri, 18 Jul 2003 16:52:54 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <2003071823525401500blss1e>; Fri, 18 Jul 2003 23:52:54 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA16465; Fri, 18 Jul 2003 16:52:53 -0700 (PDT) Date: Fri, 18 Jul 2003 16:52:52 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: <20030718232230.GA35603@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: Rearranging kse mailbox 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, 18 Jul 2003 23:52:55 -0000 On Fri, 18 Jul 2003, Marcel Moolenaar wrote: > On Fri, Jul 18, 2003 at 06:40:07PM -0400, Daniel Eischen wrote: > > > Note that the extra level of indirection on ia64 can be avoided if > > > we put the thread control structure at a negative offset from TP. > > > The layout would be something like: > > > > > > -... 0 8 16 ...+ > > > [thread structure][DTV pointer][free][static TLS] > > > ^ > > > TP > > > > Can we make this work so that we are not limited to > > 8192 (or whatever max user LDTs are) threads on i386? > > The layout may be specific to ia64. I don't think we should try to > unify too much across platforms. > > As for the LDT limit: We could keep %gs constant and change the LDT > entry on a thread switch. That way we only use 1 LDT entry... That's kind of what we do.. each KSE has an LDT When we switch the thead running on that KSE we switch the pointer at the head of the KSE mailbox. Since this is NOT the pointer used by other things it doesn't have to eb done atomically. We could even put the TLS at +VE offsett from that location as it is the TLS pointer and we have no requirement (in kse) that it also be the pointer to teh Thread mailbox or thread control block. (in fact it will NOT be the pointer to the thread mailbox as THAT has to be set atomically with the context load). We'd probably keep it -ve to be compatible with libthr and libc_r for which it would be -ve. > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net >