From owner-freebsd-threads@FreeBSD.ORG Fri Jun 20 00:32:40 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 4E0E437B401; Fri, 20 Jun 2003 00:32:40 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 699B043F75; Fri, 20 Jun 2003 00:32:39 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5K7W8DZ074132; Fri, 20 Jun 2003 00:32:08 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5K7W7R8016162; Fri, 20 Jun 2003 00:32:07 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h5K7W73j016161; Fri, 20 Jun 2003 00:32:07 -0700 (PDT) (envelope-from marcel) Date: Fri, 20 Jun 2003 00:32:07 -0700 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20030620073207.GC16066@dhcp01.pn.xcllnt.net> References: <20030620052010.GC28472@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org cc: davidxu@freebsd.org cc: Julian Elischer 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: Fri, 20 Jun 2003 07:32:40 -0000 On Fri, Jun 20, 2003 at 03:06:34AM -0400, Daniel Eischen wrote: > > Also note that there are both thread and KSE mailboxen. > The km_curthread that must be set to NULL is in the > KSE mailbox. So if all you have is TP(offset 8) pointing > to the thread TCB/mailbox, you still have another pointer > from the thread to the KSE (includes the mailbox). So > you have to atomically set curthread->curkse->km_curthread > to NULL. The thing that can change out from under you > is curthread->curkse, not curthread->curkse->km_curthread. I intend to put the TCB at a negative offset from the thread pointer on ia64. This works for both thread models and for both thread libraries. TP(8) is then free in all cases to point to something else (the KSE in this case). I have to play with it to make sure I'm not overlooking something. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net