|
Boost : |
From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-08-09 08:51:39
----- Original Message -----
From: "Darryl Green" <green_at_[hidden]>
> Basically, I think the whole "main is special" thing is a nuisance that
has
> to be lived with. However, as I understand it, there isn't really anything
> special about the "main thread" only about the main function
(specifically,
> exiting it)? We obviously cant break existing code that relies on this
> behaviour, but I think we can assume that the app developer "owns" main()
> and can stick a catch (...) there at least. It is the other threads that
are
> harder to control... Assuming we do actually get to the point of allowing
> threads to terminate due to an uncaught exception without terminating the
> whole process, the issue of just how to deal with this (which thread(s)
get
> notified? how? when?) remains an issue, and a more interesting one than
this
> tedious stuff about having to call terminate() :-)
I agree with the concern. I hope the standards committee can address this
and remove some of the "main is special" problems. But as a library
developer I can't really manage that. But I don't think that simply calling
terminate() results in the problems you think it does. By setting a
terminate() handler and checking what thread has called it, you can stop the
termination (and more importantly, set up some sort of error handling
here!).
Bill Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk