Building several dynamic libraries with one shared GC

Ali Çehreli acehreli at yahoo.com
Sun Sep 12 22:18:06 UTC 2021


On 9/12/21 1:25 PM, NonNull wrote:
> On Sunday, 12 September 2021 at 18:56:50 UTC, Ali Çehreli wrote:
>> All initialization functions of the plugins were called automatically 
>> in my D test environment and all plugins were usable. The trouble 
>> started when the main library was being used in a foreign environment 
>> (something like Python loading Python loading C++ library loading our 
>> D library): Although the initialization function of the main library 
>> was being called, the 'shared static this' functions of the plugins 
>> were not being called.
> 
> So here, your main dynamic library in turn dynamically loads plugins. 
> Did you try simply calling a function exported by a plugin from the 
> static constructor in the main library after it had made the call to 
> initialize druntime to see if that stimulated running the plugin's 
> static constructors first? The problem you linked to suggests that might 
> do the job. I haven't run into this problem yet myself. But I'm interested.

I did not try it because I learned about that potential cause after we 
worked around the issue with the daemons.

Ali




More information about the Digitalmars-d-learn mailing list