Hangs on toStringZ()

unDEFER via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 28 06:55:27 PST 2016


On Wednesday, 28 December 2016 at 12:39:46 UTC, Nemanja Boric 
wrote:
> Right, nothing wrong with threads, but super tricky to combine 
> it with fork. So, it could be that one of your threads is using 
> GC at the point of the forking, so it keeps the GC locked. Now 
> you fork, and _all your threads don't exist anymore, they are 
> vanished, and if you don't do some clever stuff in atfork 
> handler, there will be no cleanup_ - you just have copy of the 
> thread that called fork. So, the thread that should release GC 
> lock doesn't exist anymore, and there's nothing to release 
> mutex, and it will stay locked forever in your forked process.

Thanks a lot for such detailed explanation!


More information about the Digitalmars-d mailing list