small webrev to avoid loading the hsail okra library twice

Doug Simon doug.simon at oracle.com
Fri Apr 11 18:52:05 UTC 2014


On Apr 11, 2014, at 8:18 PM, Deneau, Tom <tom.deneau at amd.com> wrote:

> Doug --
> 
> After submitting this, I was wondering whether os::dll_load itself should check whether a library is already loaded (if a platform supports such a check), and if it is already loaded, just return the handle to that already loaded library?

Whether it should or not, the existing implementations of os::dll_load do not do the check. I suspect that’s probably for a good reason.

>  Or are there legimitate cases where one would actually want to load a shared library more than once?

One case may be to do concurrent testing of a shared library that has static state. However, you’d probably still be better forking in that case.

-Doug

>> -----Original Message-----
>> From: Doug Simon [mailto:doug.simon at oracle.com]
>> Sent: Friday, April 11, 2014 11:08 AM
>> To: Deneau, Tom
>> Cc: graal-dev at openjdk.java.net
>> Subject: Re: small webrev to avoid loading the hsail okra library twice
>> 
>> I'll integrated this.
>> 
>> On Apr 10, 2014, at 11:11 PM, Deneau, Tom <tom.deneau at amd.com> wrote:
>> 
>>> I posted a small webrev whose purpose is to avoid loading the hsail
>> okra shared library twice.  It turns out that some features of the hsail
>> simulator okra flavor (in particular, gdb symbols for the simulated
>> HSAIL code and the hsail registers) do not work properly when the
>> library is loaded twice.
>>> 
>>> I didn't know if there was an os-independent way to check that a
>> library was already loaded, so I wrapped I in #ifdef LINUX.  But for now
>> this logic should only be required on linux anyway.
>>> 
>>> http://cr.openjdk.java.net/~tdeneau/graal-webrevs/webrev-hsail-avoid-
>> double-dll-load/
>>> 
>>> -- Tom
> 



More information about the graal-dev mailing list