From owner-freebsd-threads@FreeBSD.ORG Sun Aug 17 14:12:31 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 0036537B404 for ; Sun, 17 Aug 2003 14:12:30 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47EB943F85 for ; Sun, 17 Aug 2003 14:12:30 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h7HLCTuN014611; Sun, 17 Aug 2003 17:12:29 -0400 (EDT) Date: Sun, 17 Aug 2003 17:12:29 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030817185015.GB928@dhcp42.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 21:12:31 -0000 On Sun, 17 Aug 2003, Marcel Moolenaar wrote: > Gang, > > 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. Other than that, the patch looks good. -- Dan Eischen