From owner-freebsd-arch Sun Jan 6 15: 7: 9 2002 Delivered-To: freebsd-arch@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 73A6C37B402 for ; Sun, 6 Jan 2002 15:07:06 -0800 (PST) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.12.1/8.12.1) id g06N5wlN020296; Sun, 6 Jan 2002 18:05:58 -0500 (EST) Date: Sun, 6 Jan 2002 18:05:58 -0500 (EST) From: Daniel Eischen To: Alfred Perlstein Cc: Archie Cobbs , Dan Eischen , arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc In-Reply-To: <20020106164046.A14427@elvis.mu.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 6 Jan 2002, Alfred Perlstein wrote: > * Archie Cobbs [020106 14:09] wrote: > > Alfred Perlstein writes: > > > > Is there a reason that getcontext and setcontext need to be > > > > system calls? > > > > > > Atomicity? > > > > That can't be why.. otherwise this would imply that just because > > something is written in assembly instead of C that it could have > > atomicity problems. > > > > BTW, I think this adding these is a great idea.. e.g., the pth port > > can take advantage of these as well. > > http://www.opengroup.org/onlinepubs/007908799/xsh/ucontext.h.html > > Defines a signal mask switchover, that's why I assumed some degree > of atomicity help from the kernel. In order to be useful in the threads library (I think), the signal mask saved and restored has to be the threads signal mask, not the process signal mask. This is why the library implementation of these functions calls _sigprocmask (which the threads library overrides). In regards to atomicity, I thought that it would prevent a signal from interrupting the process in the middle of a getcontext or setcontext such that the ucontext was incompletely saved/restored. -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message