cvs commit: src/include netdb.h resolv.h src/lib/libc/include reentrant.h src/lib/libc/net getaddrinfo.3 getaddrinfo.c gethostbydns.c gethostbyname.3 gethostbynis.c getipnodebyname.3 herror.c name6.c res_init.c res_send.c res_send_private.h ...

Brian Feldman green at FreeBSD.org
Wed Feb 25 13:03:47 PST 2004


green       2004/02/25 13:03:46 PST

  FreeBSD src repository

  Modified files:
    include              netdb.h resolv.h 
    lib/libc/include     reentrant.h 
    lib/libc/net         getaddrinfo.3 getaddrinfo.c 
                         gethostbydns.c gethostbyname.3 
                         gethostbynis.c getipnodebyname.3 herror.c 
                         name6.c res_init.c res_send.c resolver.3 
  Added files:
    lib/libc/net         res_send_private.h 
  Log:
  Make the resolver(3) and many associated interfaces much more reentrant.
  The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now
  with what should be totally reentrant, and h_errno values will now
  be preserved correctly, but this does not affect interfaces such as
  gethostbyname(3) which are still mostly non-reentrant.
  
  In all of these relevant functions, the thread-safety has been pushed
  down as far as it seems possible right now.  This means that operations
  that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected
  still under global locks that getaddrinfo(3) defines, but where possible
  the locking is greatly reduced.  The most noticeable improvement is
  that multiple DNS lookups can now be run at the same time, and this
  shows major improvement in performance of DNS-lookup threaded programs,
  and solves the "Mozilla tab serialization" problem.
  
  No single-threaded applications need to be recompiled.  Multi-threaded
  applications that reference "_res" to change resolver(3) options will
  need to be recompiled, and ones which reference "h_errno" will also
  if they desire the correct h_errno values.  If the applications already
  understood that _res and h_errno were not thread-safe and had their own
  locking, they will see no performance improvement but will not
  actually break in any way.
  
  Please note that when NSS modules are used, or when nsdispatch(3)
  defaults to adding any lookups of its own to the individual libc
  _nsdispatch() calls, those MUST be reentrant as well.
  
  Revision  Changes    Path
  1.32      +3 -2      src/include/netdb.h
  1.24      +6 -1      src/include/resolv.h
  1.3       +3 -0      src/lib/libc/include/reentrant.h
  1.24      +6 -2      src/lib/libc/net/getaddrinfo.3
  1.49      +15 -12    src/lib/libc/net/getaddrinfo.c
  1.44      +0 -1      src/lib/libc/net/gethostbydns.c
  1.31      +6 -0      src/lib/libc/net/gethostbyname.3
  1.17      +0 -2      src/lib/libc/net/gethostbynis.c
  1.11      +9 -2      src/lib/libc/net/getipnodebyname.3
  1.12      +4 -3      src/lib/libc/net/herror.c
  1.35      +14 -13    src/lib/libc/net/name6.c
  1.32      +119 -9    src/lib/libc/net/res_init.c
  1.47      +11 -8     src/lib/libc/net/res_send.c
  1.1       +82 -0     src/lib/libc/net/res_send_private.h (new)
  1.26      +11 -0     src/lib/libc/net/resolver.3


More information about the cvs-all mailing list