Boost logo

Boost :

From: Anthony Williams (anthwil_at_[hidden])
Date: 2002-08-13 10:43:06


William E. Kempf writes:
> I claimed that the concept could not be applied _to the main
> thread_, because that results in an explicit call to terminate(), possibly
> with out stack unwinding, no less.

OK, you've convinced me (with the stack-unwinding (or possible lack thereof)
issue) --- unhandled exceptions from any thread should terminate the process
by default. If a user wishes to catch/pass through exceptions from a
thread, then they can install a thread_terminate_handler (of some variety) to
do this, under the knowledge that installing such a handler for the main()
thread (which would have to be done under the guise of a real
terminate_handler, using set_terminate, even if the library hides this fact)
may skip stack unwinding, or cause other problems (depending on the platform).

Threads started with Boost.Thread can trap exceptions and call the
thread_terminate_handler explicitly, to avoid platform-dependent handling for
them (such as the immediate termination mentioned for VAX)

(BTW: Are my posts coming through in plain text now?)

Anthony


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