GC behavior and Allocators

safety0ff via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 4 11:08:09 PDT 2014


On Friday, 4 July 2014 at 14:47:12 UTC, Chris Cain wrote:
>
> If GC.enable and GC.disable truly disallowed GC running (or 
> alternative `GC.hard_disable`/`GC.hard_enable` existed that 
> guaranteed such) then you could use that to make sure that the 
> GC didn't collect in the middle of a pair of those calls.

Right, this should be sufficient in the current implementation.

On Friday, 4 July 2014 at 17:05:32 UTC, David Nadlinger wrote:
>
> There are critical regions in core.thread. While in such a 
> region, your thread will never be suspended, effectively also 
> precluding the GC from running. They are a rather dangerous 
> tool though, use them only if absolutely required and on small, 
> controlled pieces of code.

I think this will deadlock on the GC mutex.


More information about the Digitalmars-d mailing list