From owner-freebsd-threads@FreeBSD.ORG Thu Jun 19 22:20:45 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 2FB5E37B401; Thu, 19 Jun 2003 22:20:45 -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 4658643F75; Thu, 19 Jun 2003 22:20:44 -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 h5K5KCDZ073570; Thu, 19 Jun 2003 22:20:12 -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 h5K5KB17058493; Thu, 19 Jun 2003 22:20:11 -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 h5K5KBRs058481; Thu, 19 Jun 2003 22:20:11 -0700 (PDT) (envelope-from marcel) Date: Thu, 19 Jun 2003 22:20:10 -0700 From: Marcel Moolenaar To: Daniel Eischen Message-ID: <20030620052010.GC28472@dhcp01.pn.xcllnt.net> References: <20030620041234.GA28472@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 05:20:45 -0000 On Fri, Jun 20, 2003 at 01:08:46AM -0400, Daniel Eischen wrote: > > > set_mcontext() implemented in machdep.c, though. It looks > > > like you do (although nothing is done with clear_ret in > > > get_mcontext()). > > > > We cannot do anything with clear_ret, because it's based on > > assumptions that don't hold in ia64. > > How do return values from syscalls get passed back? trapframe, as normal. The point is that return registers are not part of the context and are not saved in the trapframe on entry to the kernel. The trapframe basicly contains garbage that we don't save. Hence, clearing is meaningless. > > BTW: there's no race that can't be plugged if TP doesn't point > > to the mailbox. All we need is an atomic compare-exchange and > > a retry loop... > > Ok, the only problem might be something being deallocated > out from under you. For instance, a KSE goes away (gets > deallocated) while your thread is continued on another > KSE and you are still dereferencing something that may no > longer be valid. But isn't that a generic problem and not specific to whether the thread pointer points to the curthread mailbox? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net