dlopen and memory order guarantees with threads

Carlos O'Donell carlos@systemhalted.org
Mon Mar 5 14:10:00 GMT 2012


On Sun, Mar 4, 2012 at 2:56 AM, edA-qa mort-ora-y <eda-qa@disemia.com> wrote:
> On 03/04/2012 08:30 AM, edA-qa mort-ora-y wrote:
>> I might have to go tracking through the linux kernel code now to see
>> what happens. What if the guarantee isn't actually there and we're all
>> just getting lucky?  For example, on x86 we know we don't have this
>
> I'll just reply to myself here. I'm reading the kernel docs, and
> "cachetlb.txt" in particular (as you mentioned this, perhaps not the
> doc, but the topic).
>
> It is clear there are all sorts of functions for managing the MMU to
> make the dlopen safe, so while not explicit that mmap uses them, it
> would be really silly of it not to.
>
> But overall I have to keep in mind then that dlopen is probably one of
> the most expensive function calls one can make. Indeed it looks like it
> could impact any thread whether it wants to use that loaded library or not.

Correct.

Cheers,
Carlos.



More information about the Libc-help mailing list