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 16:09:46 -0500 (CDT)

On Thu, 15 Apr 2004, Simon Josefsson wrote:

> I'm coming to that conclusion too.  But what if libltdl (perhaps as
> part of its autoconfery) could tell me if dlopen (or whatever system
> interface libltdl uses) was thread safe or not?  Having it do that
> would be useful, even if it would only indicate thread safety on Linux
> or HURD.  (Assuming those dlopen's are thread safe...)

Libtool can't tell you if the system interface is thread safe.  The
manual page might tell you if the interface is thread safe.  Whether
the interface is thread safe or not may differ between minor versions
of the operating system or versions of the C library.

I hate to be the one to tell you this, but your "reentrant" C89 code
may not actually be thread safe by default.  The reason for this is
that often times the system will apply alternate header file
definitions if the code is specifically compiled for thread safety.
For example, the system may supply a special thread-safe errno
definition and provide modified stdio macro definitions (which do
locking) if _REENTRANT (or whatever) is defined.  That means you need
to worry about threads even your code only uses C89 interfaces if you
expect your library to execute safely with multiple threads.

Some systems will supply an alternate C library, or other libraries if
the application is built to be thread safe.

There is no free lunch when it comes to thread safety.

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





reply via email to

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