[Issue 11981] unittest 'host' deadlock

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Oct 24 10:57:37 PDT 2014


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

Sean Kelly <sean at invisibleduck.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sean at invisibleduck.org

--- Comment #22 from Sean Kelly <sean at invisibleduck.org> ---
I'm unclear why you're calling thread_suspendAll/thread_resumeAll in those
examples.  These routines are for the GC to coordinate collections and have
very strict requirements imposed on their use, fairly similar to those for code
within signal handlers.  When all threads are suspended, you can't do anything
that might block (such as call malloc) or the app could deadlock.  Was this
simply for illustrative purposes?

Upon further reading, it seems like the problem was that the folks working on
dynamic library support weren't aware of this limitation.  Yes, the thread-GC
interface is very race-prone, and heavily commented as a result.  If someone
could come up with an alternative to using signals for coordinating collections
on linux, that would be awesome.

--


More information about the Digitalmars-d-bugs mailing list