cURL / Mailing Lists / curl-library / Single Mail

curl-library

enhanced asynchronous DNS lookups

From: Yang Tse <yangsita_at_gmail.com>
Date: Wed, 27 Jan 2010 20:16:43 +0100

Hi there,

The following is what I've written in the CHANGES log for this release:

Yang Tse (26 Jan 2010)
- Constantine Sapuntzakis' and Joshua Kwan's work done in the last four months
  relative to the asynchronous DNS lookups, along with with some integration
  adjustments I have done are finally committed to CVS.

  Currently these enhancements will benefit builds done using c-ares on any
  platform as well as Windows builds using the default threaded resolver.

  This release does not make generally available POSIX threaded DNS lookups
  yet. There is no configure option to enable this feature yet. It is possible
  to experimantally try this feature running configure with compiler flags that
  make simultaneous definition of preprocessor symbols USE_THREADS_POSIX and
  HAVE_PTHREAD_H, as well as whatever reentrancy compiler flags and linker ones
  are required to link and properly use pthread_* functions on each platform.

Now the follow up to all this...

Some might ask themselves why threaded DNS POSIX threads is not GA for
this release. It is simple, mainly time restrictions and also some
technical details relative to the configuration and building stages
that have to be fully addressed yet.

We can not use ACX_PTHREAD macro, in our configure script.

In order to use POSIX threads some systems require specific
preprocessor symbol definitions such as _REENTRANT, _THREAD_SAFE,
_POSIX_THREADS, _POSIX_THREAD_SAFE_FUNCTIONS, etc. Making these
definitions may modify other functions availability and interface. So
in order to properly configure libcurl we can not allow definition of
these symbols at any arbitrary point, they must only be defined in our
configure process at a point where it influences all header and
function checks, and this is quite early in the configuration process.

Just take in account that our configure script must do things right in
a huge number of different platforms and also when cross-compiling.

On the other hand the checks for pthread.h header and linkage flags,
in our case, must be done once that compiler characteristics and other
settings have been determined, thing which happens much later in the
configure script.

It is true that ACX_PTHREAD might generate the proper results for us
on some platforms, but this is greatly influenced by the fact of the
specific preprocessor symbol being already defined.

IOW GA of the POSIX threaded libcurl resolver support will have to
wait until 7.20.1

Some additional toughts I would appreciate comments.

Should we aim at one configure option to enable POSIX threads and
another one to enable the threaded resolver?

Or one option to enable POSIX threads which additionally enables
threaded resolver?

Or one option which enables threaded resolver and attempts to enable
POSIX threads?

Have fun,

-- 
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-27