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

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 1 Nov 1999, Nate Williams wrote:

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

Another method is to try and make resources knowledgeable about
their owner(s), and for each thread to maintain a list of held
resources.  If a thread exits abnormally, it's easy enough to
walk the list and free the held resources.

Dan Eischen
eischen@vigrid.com





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.991101153827.20619B-100000>