www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DLLs and GC

reply bobef <bobef_member pathlink.com> writes:
I've wondered, when I have DLL I initalize new GC in it, isn't? So if I exchange
variables between DLL and EXE or another DLL or whatever, isn't it possible my
data to be considered "unused" in the one garbage collector and get freed and
the when I try ot access it in the other module I get an unwanted results? Not
that I had such experience but it crossed my mind...
Jun 04 2005
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"bobef" <bobef_member pathlink.com> wrote in message 
news:d7s3or$2j35$1 digitaldaemon.com...
 I've wondered, when I have DLL I initalize new GC in it, isn't? So if I 
 exchange
 variables between DLL and EXE or another DLL or whatever, isn't it 
 possible my
 data to be considered "unused" in the one garbage collector and get freed 
 and
 the when I try ot access it in the other module I get an unwanted results? 
 Not
 that I had such experience but it crossed my mind...

Look in the D spec in the DLL section. It explains all about this problem, and how to deal with it (namely, using one GC instance for the main thread and all loaded DLLs). :)
Jun 04 2005
parent bobef <bobef_member pathlink.com> writes:
Yes it is all there. I must have missed it... Thank you.


In article <d7sfc9$2s51$1 digitaldaemon.com>, Jarrett Billingsley says...
"bobef" <bobef_member pathlink.com> wrote in message 
news:d7s3or$2j35$1 digitaldaemon.com...
 I've wondered, when I have DLL I initalize new GC in it, isn't? So if I 
 exchange
 variables between DLL and EXE or another DLL or whatever, isn't it 
 possible my
 data to be considered "unused" in the one garbage collector and get freed 
 and
 the when I try ot access it in the other module I get an unwanted results? 
 Not
 that I had such experience but it crossed my mind...

Look in the D spec in the DLL section. It explains all about this problem, and how to deal with it (namely, using one GC instance for the main thread and all loaded DLLs). :)

Jun 04 2005