[Issue 4890] GC.collect() deadlocks multithreaded program.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 5 11:52:59 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=4890

--- Comment #20 from Sean Kelly <sean at invisibleduck.org> ---
It should.  Not doing so seems pretty broken.  But it this particular kernel it
seems like maybe signals are ignored in this situation.

What's happening specifically is that the one thread is blocked on the mutex
protecting the GC, and another thread holds that lock and is attempting a
collection.

I could change this code to use a spin lock instead, but the same problem could
crop up with any mutex if I understand the problem correctly.  I'm kind of
curious to see whether the Boehm GC deadlocks in a similar situation with this
kernel.  It should, since last time I checked it coordinated collections the
exact same way on Linux.

--


More information about the Digitalmars-d-bugs mailing list