Boost logo

Boost :

From: Eric Woodruff (Eric.Woodruff_at_[hidden])
Date: 2002-08-16 09:44:04


What resources are leaked? Of course I'm making a big assumption about how
the compiler behaves under the hood, but, since it clearly _has_ to create a
duplicate instance of an exception that is thrown, on the heap, there is no
other way it would implement the exception.

----- Original Message -----
From: Carl Daniel
Newsgroups: gmane.comp.lib.boost.devel
Sent: Friday, 2002:August:16 9:53 AM
Subject: Re: Threads & Exceptions - Safety Verification

"Eric Woodruff" <Eric.Woodruff_at_[hidden]> wrote in message
news:043401c244e6$8d68d5e0$1800000a_at_soy...
> Can anyone vouch for the safety of using boost::thread_exit () [which has
> yet to be implemented AFAIK] to allow exceptions to be propagated across
> threads on multiple platforms (besides the apparent working status of the
> pthread example below)?

Two BIG problems:
1. You're calling delete on an object which was not obtained by a
corresponding call to new - undefined loud boom happens.
2. Terminating a thread in the middle of a catch block is likely to cause
resources allocated by the exception propagation mechanism to be leaked -
unless, of course, boost:thread_exit is implemented by the compiler itself
and takes whatever steps are necessary.

-cd

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk