[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] pre-c89 in libltdl
From: |
Gary V. Vaughan |
Subject: |
Re: [RFC] pre-c89 in libltdl |
Date: |
Tue, 20 Apr 2004 19:32:28 +0100 |
User-agent: |
Mozilla Thunderbird 0.5 (X11/20040208) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bob Friesenhahn wrote:
| On 20 Apr 2004, Alexandre Oliva wrote:
|
|>>As I am on a libltdl code simplification fix, a patch to drop MUTEX
|>>fluff
|>>entirely will be on its way shortly...
|>
|>Leaving mutexes up to the caller means that an app that links with
|>multiple libraries that each wants to ltdlopen other stuff, odds are
|>that the libs are all going to have to be modified to use a single
|>mutex. Remember that if each caller uses its own mutex, each one
|
|
| This is a good point.
Except that I am pretty sure libltdl will choke if you link 2 libraries
that each use it :-(
On the other hand, my next refactoring patch will use preloading through
the libltdl apis to load the other loaders -- to make that work (so that
another caller can use libltdl concurrently) I'll have to fix that problem
if I trip over it.
| The problem with the libltdl thread-safety-support APIs as they exist
| today is that they require a higher-level locking mechanism than a
| simple POSIX mutex since they require that the user-provided lock be
| re-entrant when invoked by the locking thread. POSIX mutexes are not
| re-entrant by the same thread.
|
| It is wise to protect dl* calls since any POSIX specification for
| these APIs is relatively new and the extra protection should not cause
| any harm.
If a thread-safe library is using libltdl, then I'd be interested to see
how it does it, because as Bob says, we don't have POSIX compliant locking.
I suspect that such libraries already POSIX mutex lock around our APIs
anyhow, and 2 such libraries will each have their own mutex -- so we have
the same problem. Plus a bunch of unused (untested!) mutex fluff in our
code.
I'm still for removing the current mutex implementation, with an eye to
putting a POSIX compatible implementation back in when I've pulled apart
the ugly bits in ltdl.c to remove the reentrant lock requirement.
Cheers,
Gary.
- --
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAhWy8FRMICSmD1gYRAh1iAJ9/qwsWBTEN/20YC8RL+G8U/RjXVQCgxTGn
gLaAB24Ae8P4XX4sse7Nda0=
=wrqW
-----END PGP SIGNATURE-----
- Re: [RFC] pre-c89 in libltdl, (continued)
- Re: [RFC] pre-c89 in libltdl, Simon Josefsson, 2004/04/15
- Re: [RFC] pre-c89 in libltdl, Bob Friesenhahn, 2004/04/15
- RE: [RFC] pre-c89 in libltdl, Howard Chu, 2004/04/15
- Re: [RFC] pre-c89 in libltdl, Gary V . Vaughan, 2004/04/19
- Re: [RFC] pre-c89 in libltdl, Alexandre Oliva, 2004/04/20
- Re: [RFC] pre-c89 in libltdl, Simon Josefsson, 2004/04/20
- Re: [RFC] pre-c89 in libltdl, Albert Chin, 2004/04/20
- Re: [RFC] pre-c89 in libltdl, Simon Josefsson, 2004/04/20
- Re: [RFC] pre-c89 in libltdl, Alexandre Oliva, 2004/04/21
- Re: [RFC] pre-c89 in libltdl, Bob Friesenhahn, 2004/04/20
- Re: [RFC] pre-c89 in libltdl,
Gary V. Vaughan <=
- Re: [RFC] pre-c89 in libltdl, Bob Friesenhahn, 2004/04/20
- Re: [RFC] pre-c89 in libltdl, Gary V. Vaughan, 2004/04/22
- Re: [RFC] pre-c89 in libltdl, Simon Josefsson, 2004/04/15