Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Jan 2002 21:33:51 -0500
From:      Dan Eischen <eischen@vigrid.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Daniel Eischen <eischen@pcnet1.pcnet.com>, arch@FreeBSD.ORG
Subject:   Re: Request for review: getcontext, setcontext, etc
Message-ID:  <3C3A5A8F.FA00B480@vigrid.com>
References:  <20020108124257.Y2997-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote:
> 
> On Mon, 7 Jan 2002, Daniel Eischen wrote:
> 
> > On Tue, 8 Jan 2002, Bruce Evans wrote:
> > > That makes sense.  Is signal handling required to be "normal" in the
> > > POSIX threads library?  If so, then the implementation can't use an
> > > alternate signal stack like this.
> >
> > I don't know if you would call it "normal", but POSIX does define
> > how signals should work in a threaded application.  POSIX also
> > says that the use of sigaltstack in a threaded application is
> > undefined, so it seemed like it would be OK for the implementation
> > to use it.
> 
> The system has a "normal" stack limit of 64MB, and I wonder how much
> the pthreads implementation can reasonbly disturb this.  I guess
> POSIX can't say much about this since a general POSIX system might
> not even have a stack.

I just took another look at the code.  I don't think your problem
was the size of the alternate signal stack.  The threads library
uses the alternate signal stack to catch the signal but then sets
up its own signal frame on top of the stack of whatever thread
it determines should get the signal (sorry about the long sentence).
It then performs a context switch to that thread and the application's
signal handler is called.

Libc_r uses 1MB for the stack of the main thread, and 64K the other
thread's stack.  S it was probably the stack size of the main thread
that was causing your test program problems, not the alternate
signal stack.

-- 
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?3C3A5A8F.FA00B480>