[D-runtime] druntime should be a shared library/DLL

Walter Bright walter at digitalmars.com
Wed Feb 6 16:10:23 PST 2013


On 2/6/2013 3:23 PM, David Nadlinger wrote:
> On Wed, Feb 6, 2013 at 11:15 PM, Walter Bright <walter at digitalmars.com> wrote:
>> This would go a long ways towards solving the dll issue, as then the gc and
>> thread instances will automatically be shared.
> Could you elaborate a bit?
>
> As far as I can see, it would not change anything about the fact that
> you need to be able to handle GC ranges from multiple images (static
> data, TLS) that are added/removed dynamically.
>

The thread code has some global variables where it keeps track of all threads. 
With the static library approach, there are two sets of these variables, and two 
sets of code to deal with them. They will conflict with each other, and any 
attempt to make DLLs will have to have some mechanism to decide which one wins. 
With druntime itself as a DLL, this is not an issue.

The same problem with the gc.


More information about the D-runtime mailing list