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

Dsby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 30 19:45:01 PST 2016


On Saturday, 30 January 2016 at 16:06:37 UTC, Chris Wright wrote:
> On Sat, 30 Jan 2016 14:41:18 +0000, Dsby wrote:
>
>> Use the D dylib in my C++ program,when the D's GC(in the dylib 
>> runtime) run. will not my program stop?
>
> The GC will stop every thread it knows about. If you have a C++ 
> thread that you want to run while the GC is running, you can 
> get that by not telling the D runtime about it. This will limit 
> your ability to interact with D from that thread somewhat -- 
> and it will interfere more with your ability to *safely* 
> interact with D even more.
>
> If you never allocate GC memory, of course, the GC will never 
> run.

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


More information about the Digitalmars-d-learn mailing list