Idiomatic D using GC as a library writer

Adam D Ruppe destructionator at gmail.com
Sun Dec 4 17:53:00 UTC 2022


On Sunday, 4 December 2022 at 16:02:28 UTC, Ali Çehreli wrote:
> D's GC needed to stop the world, which meant it would have to 
> know what threads were running. You can never be sure whether 
> your D library function is being called from a thread you've 
> known or whether the Java runtime (or other user code) just 
> decided to start another thread.

Interesting... you know, maybe D's GC should formally expose a 
mutex that you can synchronize on for when it is running. So you 
can cooperatively do this in the jni bridge or something. Might 
be worth considering.

I've heard stories about similar things happening with C#.


More information about the Digitalmars-d-learn mailing list