Use the D dylib in my C++ program,when the D's GC(in the dylib runtime) run. will not my program stop?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 30 21:28:02 PST 2016


On Sunday, 31 January 2016 at 03:45:01 UTC, Dsby wrote:

>
> Thanks, if I use the D dylib,I should run " rt_init(); " in 
> every thread which i used the D dylib?

No. rt_init only needs to be called once for the process. You 
need to call core.thread.attach_this [1] so that runtime is aware 
of your external thread. Note that this does not apply to the 
thread that calls rt_init.

[1] http://dlang.org/phobos/core_thread.html#.thread_attachThis


More information about the Digitalmars-d-learn mailing list