druntime thread (from foreach parallel?) cleanup bug

Steven Schveighoffer schveiguy at gmail.com
Tue Nov 1 18:18:45 UTC 2022


On 11/1/22 1:47 PM, mw wrote:
>> Can you show a code snippet that includes the parallel foreach?
> 
> (It's just a very straight forward foreach on an array; as I said it may 
> not be relevant.)
> 
> 
> And I just noticed, one of the thread trace points to here:
> 
> https://github.com/huntlabs/hunt/blob/master/source/hunt/util/DateTime.d#L430
> 
> ```
> class DateTime {
>    shared static this() {
>      ...
>      dateThread.isDaemon = true;  // not sure if this is related
>    }
> }
> ```
> 
> in the comments, it said: "BUG: ... crashed".  Looks like someone run 
> into this (cleanup) issue already, but unable to fix it.
> 
> Anyway I logged an issue there:
> 
> https://github.com/huntlabs/hunt/issues/96
> 
> 

Oh yeah, isDaemon detaches the thread from the GC. Don't do that unless 
you know what you are doing.

-Steve


More information about the Digitalmars-d-learn mailing list