How to ensure a thread cannot be blocked by the GC?

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Dec 3 17:36:11 PST 2014


On Thursday, 4 December 2014 at 00:27:49 UTC, Ola Fosheim Grøstad 
wrote:
> IRRC the D GC uses SIGUSR1 on unix, so there you should be able

Hmmm, I have no idea why I wrote this. According to the code for 
the runtime it only suspends threads that inherit from Thread? GC 
fullcollect calls thread_suspendAll which traverses a linked list 
of Threads.

So I suppose none of your threads are suspended unless you 
suspend it with Thread on call_back entry? But why suspend a 
@nogc thread?

https://github.com/D-Programming-Language/druntime/blob/master/src/core/thread.d#L2501

https://github.com/D-Programming-Language/druntime/blob/master/src/gc/gc.d#L2479




More information about the Digitalmars-d-learn mailing list