classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cp-patches] Patch: java/lang/Runtime.java


From: Jeroen Frijters
Subject: RE: [cp-patches] Patch: java/lang/Runtime.java
Date: Tue, 7 Sep 2004 09:17:18 +0200

Archie Cobbs wrote:
> Mark Wielaard wrote:
> > It is per VM even since JNI doesn't allow a given JNI 
> native library to
> > be loaded by more than one class loader.
> 
> This silly restriction is only because dlopen()'ing the same file
> twice doesn't map in the library twice, instead you just get another
> reference to the already-mapped memory. This is really a deficiency
> in the dlopen() API IMHO that the JVM inherits and consequently is
> limited by.

This is somewhat counterintuitive for a shared library, so I can
understand why the original shared library design doesn't include this.
Adding it on later is hard because existing libraries will assume that
they're only loaded once, so you'd need a flag in the library that says
it is capable of being loaded more than once in the same address space.

> If you could dlopen(..., RTLD_COPY) or whatever then this 
> problem could go away... also, a gross hack would involve copying
> the library to /tmp, dlopen()'ing it, then removing it.

Before XP, Windows had the same limitation (and I imagine many other
platforms) so Java would probably not be able to use it if it were
possible.

Regards,
Jeroen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]