Thread overview | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 10, 2013 core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
http://dlang.org/phobos/core_runtime.html#.Runtime.loadLibrary I want to load shared libraries during runtime as plug-in's, but the consensus seemed to indicate that DMD is not yet ready for this. I wonder if these functions provide any useful plug-in support or not? Thanks! --rt |
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rob T | On Thursday, January 10, 2013 08:35:53 Rob T wrote:
> http://dlang.org/phobos/core_runtime.html#.Runtime.loadLibrary
>
> I want to load shared libraries during runtime as plug-in's, but the consensus seemed to indicate that DMD is not yet ready for this. I wonder if these functions provide any useful plug-in support or not?
I don't know what the state of those functions is, but the GC can't handle shared libraries at this point. I believe that that's the main reason why shared libraries are a no-go at this point. And with a problem like that, it seems to me like a _really_ bad idea to try and use them. If I were you, I'd keep away from them until druntime was fixed to properly support them. That's certainly what I intend to do.
- Jonathan M Davis
|
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Thursday, 10 January 2013 at 07:52:19 UTC, Jonathan M Davis wrote:
> On Thursday, January 10, 2013 08:35:53 Rob T wrote:
>> http://dlang.org/phobos/core_runtime.html#.Runtime.loadLibrary
>>
>> I want to load shared libraries during runtime as plug-in's, but
>> the consensus seemed to indicate that DMD is not yet ready for
>> this. I wonder if these functions provide any useful plug-in
>> support or not?
>
> I don't know what the state of those functions is, but the GC can't handle
> shared libraries at this point. I believe that that's the main reason why
> shared libraries are a no-go at this point. And with a problem like that, it
> seems to me like a _really_ bad idea to try and use them. If I were you, I'd
> keep away from them until druntime was fixed to properly support them. That's
> certainly what I intend to do.
>
> - Jonathan M Davis
what's wrong with them? already used it on windows and mac, no problems so far, though not tested too deep, and not with D shared libs o_O
|
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On Thursday, January 10, 2013 11:31:50 evilrat wrote:
> what's wrong with them? already used it on windows and mac, no problems so far, though not tested too deep, and not with D shared libs o_O
C shared libraries are fine. It's D shared libraries that are the problem. I don't remember the details, but IIRC, among other things, you end up with multiple copies of the GC running. The runtime needs a variety of non-trivial tweaks to it order to fix those problems before shared D libraries become viable.
- Jonathan M Davis
|
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Thursday, 10 January 2013 at 10:43:14 UTC, Jonathan M Davis wrote: > The runtime needs a variety of non-trivial tweaks to it order to fix those problems before shared D libraries become viable. tweaks like this http://dlang.org/dll.html#Dcode ? |
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On Thursday, January 10, 2013 11:54:03 evilrat wrote:
> On Thursday, 10 January 2013 at 10:43:14 UTC, Jonathan M Davis
>
> wrote:
> > The runtime needs a variety of non-trivial tweaks to it order to fix those problems before shared D libraries become viable.
>
> tweaks like this http://dlang.org/dll.html#Dcode ?
I don't know any of the details, but that page does seem to discuss at least some of the issues. Other folks around here are far more familiar with what the exact situation is than I am.
- Jonathan M Davis
|
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Thursday, 10 January 2013 at 11:00:55 UTC, Jonathan M Davis wrote:
> On Thursday, January 10, 2013 11:54:03 evilrat wrote:
>> On Thursday, 10 January 2013 at 10:43:14 UTC, Jonathan M Davis
>>
>> wrote:
>> > The runtime needs a variety of non-trivial tweaks to it order
>> > to fix those problems before shared D libraries become viable.
>>
>> tweaks like this http://dlang.org/dll.html#Dcode ?
>
> I don't know any of the details, but that page does seem to discuss at least
> some of the issues. Other folks around here are far more familiar with what
> the exact situation is than I am.
>
> - Jonathan M Davis
well anyway thanks for info, this would definitely save some time if i encounter some bugs while doing D shared libs.
|
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On 2013-01-10 11:54, evilrat wrote: > tweaks like this http://dlang.org/dll.html#Dcode ? Tweaks like this: https://github.com/dawgfoto/druntime/tree/SharedRuntime -- /Jacob Carlborg |
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On 2013-01-10 11:31, evilrat wrote: > what's wrong with them? already used it on windows and mac, no problems > so far, though not tested too deep, and not with D shared libs o_O Apparently you haven't tested at all on Mac since it's only implemented on Windows: https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L122 -- /Jacob Carlborg |
January 10, 2013 Re: core.runtime: loadLibrary and unloadLibrary? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On 2013-01-10 08:51, Jonathan M Davis wrote: > I don't know what the state of those functions is, but the GC can't handle > shared libraries at this point. I believe that that's the main reason why > shared libraries are a no-go at this point. And with a problem like that, it > seems to me like a _really_ bad idea to try and use them. If I were you, I'd > keep away from them until druntime was fixed to properly support them. That's > certainly what I intend to do. The state is that they're only implement on Windows: https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L122 About D shared libraries, this is what's missing: The runtime need to collect the following from all loaded images (shared libraries and executables) and all that are loaded during program execution: * Exception handling tables * Ranges scanned by the GC * TLS data There are more issues than listed above that I can remember right now. -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation