From owner-freebsd-threads@FreeBSD.ORG Sun Aug 17 15:06:26 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 0C87237B408 for ; Sun, 17 Aug 2003 15:06:26 -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 7FE4643F3F for ; Sun, 17 Aug 2003 15:06:24 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp42.pn.xcllnt.net (dhcp42.pn.xcllnt.net [192.168.4.242]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7HM6OwO098742; Sun, 17 Aug 2003 15:06:24 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp42.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7HM6OR6001818; Sun, 17 Aug 2003 15:06:24 -0700 (PDT) (envelope-from marcel@dhcp42.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h7HM6O0n001817; Sun, 17 Aug 2003 15:06:24 -0700 (PDT) (envelope-from marcel) Date: Sun, 17 Aug 2003 15:06:23 -0700 From: Marcel Moolenaar To: Daniel Eischen Message-ID: <20030817220623.GA1661@dhcp42.pn.xcllnt.net> References: <20030817185015.GB928@dhcp42.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 Subject: Re: First draft: rewrite of {get|set|swap}context(3) 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: Sun, 17 Aug 2003 22:06:26 -0000 On Sun, Aug 17, 2003 at 05:12:29PM -0400, Daniel Eischen wrote: > On Sun, 17 Aug 2003, Marcel Moolenaar wrote: > > > Please review the attached patch and let me know to what extend it > > introduces breakages. It is the result of "aggressive engineering" > > to provoke comments and further fuel discussion. The reason for this > > approach is that we currently do not initialize any fields other than > > the mcontext and sigmask and only partially copyin() and copyout() > > the contexts (typically only the mcontext and sigmask fields). This > > generally is very sensitive to breakages, especially when we intro- > > duce flags or need to use any of the spare fields. > > > > getcontext(3): the whole ucontext is zeroed before (partially) filled > > and we copyout() all of it. This means that uc_link can only > > be set/defined after calling setcontext(). > > This prevents reuse of the same context without resetting > uc_link after every usage. I don't see any requirement > by POSIX that uc_link be left intact after getcontext(), > but it might be worth preserving... It's up to you. Yes, it's a tricky issue. I'll begin runtime testing and think about it some more. I don't want to rush it... BTW: I think we need to preserve uc_stack as well. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net