[phobos] parallelism segfaults

Sean Kelly sean at invisibleduck.org
Wed Sep 14 11:53:50 PDT 2011


On Sep 14, 2011, at 10:03 AM, David Simcha wrote:

> How about this:  Could we send all daemon threads hardware exceptions after joinAll()?  In the vast majority of cases, locks will be scoped, either through synchronized blocks or simple scope(exit) mutex.unlock() type statements.  If they're not then they should be.  (If any still aren't in std.parallelism then I'll fix this.  I originally made a few non-scoped around code that couldn't throw, but this was silly and I think I changed all of them.)  This way daemon threads terminate immediately, locks get released if the code's well-written, 
> and if you **really** need to do some cleanup, you can catch the exception.

How would we do this?  Signals don't cause an exception to be thrown (because it's technically illegal to throw from a signal handler).  Is there some other way we could sent a hardware exception to a thread that would cause it to terminate cleanly?


More information about the phobos mailing list