Date: Sun, 6 Jan 2002 18:05:58 -0500 (EST) From: Daniel Eischen <eischen@pcnet1.pcnet.com> To: Alfred Perlstein <bright@mu.org> Cc: Archie Cobbs <archie@dellroad.org>, Dan Eischen <eischen@vigrid.com>, arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc Message-ID: <Pine.SUN.3.91.1020106180035.19156A-100000@pcnet1.pcnet.com> In-Reply-To: <20020106164046.A14427@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 6 Jan 2002, Alfred Perlstein wrote: > * Archie Cobbs <archie@dellroad.org> [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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1020106180035.19156A-100000>