Boost logo

Boost :

From: Eric Woodruff (Eric.Woodruff_at_[hidden])
Date: 2002-08-08 16:45:03


Have you ever considered writing an "application" class and thus eliminating
main? ;)

The application_base could call thread_exit () in it's destructor.

----- Original Message -----
From: William E. Kempf
Newsgroups: gmane.comp.lib.boost.devel
Sent: Thursday, 2002:August:08 5:37 PM
Subject: Re: Re: Re: Threads & Exceptions

----- Original Message -----
From: "Anthony Williams" <anthwil_at_[hidden]>

> I am inclined to go with Iain --- if there is an uncaught exception, it
> calls thread_terminate. This is in keeping with the current Standard,
where
> if there is an uncaught exception, then the current (the only) thread is
> terminated.
>
> You could even provide this behaviour for the main thread of current
> systems, by providing a terminate_handler that does thread_terminate,
rather
> than abort.

This isn't consistent with defined behavior for all platforms I know. And I
agree with their behavior. If main() exits in any manner other than a call
to (platform equivalent) thread_exit() then the process is terminated
immediately. I can't see any way to implement thread_terminate() in a
logical fashion for the main thread given these semantics, and trying to
change those semantics requires the library to somehow enforce calling
thread_exit() when leaving main().

Bill Kempf
_______________________________________________
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