How to ensure a thread cannot be blocked by the GC?
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Dec 3 18:01:25 PST 2014
On Thursday, 4 December 2014 at 01:36:13 UTC, Ola Fosheim Grøstad
wrote:
> 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?
What a mess of incorrect recollection and typos (it is late, 3AM
:-P): I meant to say that I suppose none of your threads are
suspended unless you register it as a Thread before the call_back
entry. But if you do it on the call_back entry point by
registering a fake Thread object you must ensure that you are not
already in a collection cycle before continuing…
Seems to me that there should either be better documentation of
GC behaviour or some extra functionality for controlling GC
interference with threads and Threads. I also find this
confusing… There is a lot of policy making in D's runtime and
standard library.
More information about the Digitalmars-d-learn
mailing list