libtool-patches
[Top][All Lists]
Advanced

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

Re: [RFC] pre-c89 in libltdl


From: Bob Friesenhahn
Subject: Re: [RFC] pre-c89 in libltdl
Date: Thu, 15 Apr 2004 15:36:23 -0500 (CDT)

On Thu, 15 Apr 2004, Simon Josefsson wrote:
>
> My man page says "POSIX 1003.1]2003 describes dlclose, dlerror,
> dlopen, dlsym".

So does mine (on recent Gentoo Linux).  There is no use of the word
"thread" anywhere, and the dlerror() function has a signature which
would require use of thread-specific storage in order to be thread
safe.

> So my preferred approach would be to only enable the use of libltdl if
> I know it would be thread safe.

Since you have no way of knowing if libltdl or dlopen, dlerror, dlsym,
dlclose, will be thread safe and you are not willing to add locks to
ensure thread safety, then it sounds like you shouldn't be using
loadable modules. :-)

The easiest solution is usually to use POSIX thread locking and then
tell users they will need to add -lpthread in order to use your
library.

> Perhaps I shouldn't be using libltdl?  If POSIX says dlopen is thread
> safe (I have to read up on that), I could check for a POSIX dlopen and
> only use modules if the system has POSIX dlopen.  Alas, if say

It will take about 7 years before any ratified POSIX standard is in
common-enough use that you can rely on it.  If the OS is Linux, then
you may need to wait longer (witness how long POSIX.4 APIs are taking
to get implemented).

Bob
======================================
Bob Friesenhahn
address@hidden
http://www.simplesystems.org/users/bfriesen





reply via email to

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