From owner-freebsd-threads@FreeBSD.ORG Thu Jun 19 16:12:52 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 D37C837B401 for ; Thu, 19 Jun 2003 16:12:52 -0700 (PDT) Received: from rwcrmhc11.attbi.com (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A7FD43FCB for ; Thu, 19 Jun 2003 16:12:52 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc11) with ESMTP id <20030619231251013008ud4ae>; Thu, 19 Jun 2003 23:12:52 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA50513; Thu, 19 Jun 2003 16:12:51 -0700 (PDT) Date: Thu, 19 Jun 2003 16:12:50 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: Implementing TLS: step 1 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: Thu, 19 Jun 2003 23:12:53 -0000 BTW Marcel, I think that we can get from where we are now with kse to what we need by just a little massaging of what points to what. it is possible that the register %gs could be pointed to the thread structure directly and we could derive the KSE from that. it will just make the context switches a fraction more expensive if we need to change the segment register.. The big cost is that a processin x86 can only have a limited number of segments set up in teh Local descriptor table (LDT). I forget the actual number but i vaguely remember that it is 16383 or 8191 or something.. A process could theoretically want to have more than that numbe rof threads.. By pointing to the KSE we limit ourselves to having to set up onl a small number of LDT entries which is a big saving. On ia64 we don;t need to use descriptors so there is not that limit so in effect we could point directly to the thread descriptor and let THAT point to teh VCPU mailbox in question. it's just an extra write or two at context switch time. I think we'll be just fine.