[prev in list] [next in list] [prev in thread] [next in thread] 

List:       glibc-help
Subject:    dlopen with RTLD_PRIVATE?
From:       tom () tvandijk ! nl (Tom van Dijk)
Date:       2015-05-27 10:07:00
Message-ID: CA+1vucZJr6f0F0-KsFYr4jAOza7YvpJwUuCONi+-0b+9HKZm8g () mail ! gmail ! com
[Download RAW message or body]

Hello,

Judging from a cursory search on the internet, quite a few people
would love to have dlopen with an RTLD_PRIVATE flag, which would allow
opening a .so file that has some internal state multiple times.

for example:

http://stackoverflow.com/questions/24365989/loading-two-instances-of-a-shared-library-without-rtld-private-or-multiple-copie


http://stackoverflow.com/questions/3433522/loading-two-instances-of-a-shared-library

This appears to be implemented eg in UnixWare:
http://uw714doc.sco.com/en/man/html.3C/dlopen.3C.html

Our my case, I'd like to load a .so that is not thread-safe for every
thread. Using only one instance protected with a mutex is not an
option, as I'm interested in a highly parallel application.

Is this something that is difficult to implement in glibc for some
reason? Or is there already some solid alternative for this problem? A
search did not find satisfactory solutions, although there is a
workaround by copying the library to uniquely named files in /tmp on
runtime and loading each copied file separately, but I'd say you'd
agree that this is a pretty dirty solution.

Cheers,
Tom.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic