Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Aug 2003 23:04:30 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        threads@freebsd.org
Subject:   Re: First draft: rewrite of {get|set|swap}context(3)
Message-ID:  <Pine.GSO.4.10.10308172303500.29967-100000@pcnet5.pcnet.com>
In-Reply-To: <20030817220623.GA1661@dhcp42.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 17 Aug 2003, Marcel Moolenaar wrote:

> 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.

Yes, I think that's a good idea.

-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10308172303500.29967-100000>