Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Nov 1999 13:59:22 -0700
From:      Nate Williams <nate@mt.sri.com>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        Nate Williams <nate@mt.sri.com>, "Justin T. Gibbs" <gibbs@freebsd.org>, Julian Elischer <julian@whistle.com>, freebsd-arch@freebsd.org
Subject:   Re: Threads models and FreeBSD. 
Message-ID:  <199911012059.NAA19090@mt.sri.com>
In-Reply-To: <Pine.SUN.3.91.991101153827.20619B-100000@pcnet1.pcnet.com>
References:  <199911012002.NAA18597@mt.sri.com> <Pine.SUN.3.91.991101153827.20619B-100000@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > What about being able to push and pop cleanup handlers in the
> > > kernel?  It's not quite as elegant as exception handlers, but
> > > would it accomplish what you want?
> > 
> > I think the complexity would be much greater, but maybe I don't
> > understand fully what you are saying.
> > 
> > Can you give a simple code example?
> 
> see man pthread_cleanup_push(3).  If a kernel thread were abnormally
> terminated it would run down its list of cleanup handlers to free
> held resources.

That's much more complicated that doing exception handling, since it's
*very* obvious what happened when dealing with exceptions.

Otherwise, you have to make some guesses as to which resource caused
problems, and such.  It might even be able to recover in some cases,
depending on where the error occurred.

This is how C++/Java do things, and it's very intuitive...  (Modula-3
might also do this, but I'm not familiar enough with them to say with
authority...)



Nate




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?199911012059.NAA19090>