should a thread print exceptions?

Sean Kelly sean at invisibleduck.org
Wed Jul 11 12:21:39 PDT 2012


On Jul 9, 2012, at 3:18 AM, maarten van damme wrote:

> When a thread crashes or an assertion fails, should it print out those
> errors (like the main thread)
> Currently it quietly quits without any information whatsoever. Is
> there any way to still make it output that valuable information?

If you join the thread the exception will be re-thrown in the context of the joining thread.  I've been considering changing the behavior to terminate the app if an Error is thrown in a thread, but so far have not done this because basically no cleanup would occur, unlike when an Error is thrown in the main thread.  Alternately, I've considered having all app threads be actual threads so the main thread wouldn't get special treatment.  If we move towards green-threading with std.concurrency this is basically what would be needed anyway, but I'm not sure it's appropriate as the default behavior for a systems language.


More information about the Digitalmars-d mailing list