This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: dlopen handles and multiple threads
- From: Rich Felker <dalias at libc dot org>
- To: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Cc: Will Newton <will dot newton at linaro dot org>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 3 Jul 2014 10:13:48 -0400
- Subject: Re: dlopen handles and multiple threads
- Authentication-results: sourceware.org; auth=none
- References: <6D39441BF12EF246A7ABCE6654B0235320E5E2BD at LEMAIL01 dot le dot imgtec dot org> <CANu=Dmg3YzmN71OoapNFgotgCpMGmpZcKJwJvmAKqV0ngM5h0w at mail dot gmail dot com> <6D39441BF12EF246A7ABCE6654B0235320E5E3D6 at LEMAIL01 dot le dot imgtec dot org>
On Thu, Jul 03, 2014 at 11:20:58AM +0000, Matthew Fortune wrote:
> > I believe all three are valid assuming the handle/function pointer is
> > safely passed between the threads. Is there a reason you believe they
> > may not be valid?
>
> No I have no reason to believe they are invalid. I was just hoping they
> might be for a reason that I did not know! This is related to the MIPS
> ABI work which is progress for transitioning O32 from FR0 to FR1.
Do you have a draft document on this design I can look at?
> It came to light that performing a mode switch during dlopen on one thread
> would not update the mode on any other thread sharing the address space. The
> mode change would be a pre-requisite of executing any code in the newly
> opened library. If a different thread accesses that code in its
> pre-existing mode then it would fail.
If the mode has not something changed at each call between functions
where the ABI differs, but something that you can just set globally
when FR1 code is loaded, why isn't it just always set for FR1?
If it is something that has to be set at call time, then why would
dlopen need to set it, and how would doing so not break existing FR0
code in the caller?
Rich