Leave GC collection to the user of the D library?

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue May 11 02:15:35 UTC 2021


On Sunday, 9 May 2021 at 20:53:28 UTC, Ali Çehreli wrote:
> That can be achieved by some changes but the issue is not with 
> the backend (the daemon); rather, the foreign threads that call 
> the thin library layer.
>
> [...]
>
> Aside: I've been under the impression that there couldn't be 
> new pipes opened but I learned that a file descriptor can be 
> passed to another process over unix domain sockets (only Linux 
> is interesting to me here) and the file descriptor and its 
> "passed copy" can be used like a pipe:
>
>
> https://stackoverflow.com/questions/2358684/can-i-share-a-file-descriptor-to-another-process-on-linux-or-are-they-local-to-t

Yes. But, all of this requires shared state, which requires 
synchronization and/or initialization. Alternatively, each thread 
would be entirely self-contained (and own its personal worker 
process), which avoids those issues entirely. (Perhaps with TLS, 
or better, by making the C++ caller own the state object.)



More information about the Digitalmars-d mailing list