+3781. [tuning] Use adaptive mutex locks when available; this
+ has been found to improve performance under load
+ on many systems. "configure --with-locktype=standard"
+ restores conventional mutex locks. [RT #32576]
+
3780. [bug] $GENERATE handled negative numbers incorrectly.
[RT #25528]
/* Define if your PKCS11 provider supports GOST. */
#undef HAVE_PKCS11_GOST
+/* Support for PTHREAD_MUTEX_ADAPTIVE_NP */
+#undef HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
+
/* Define to 1 if you have the `pthread_yield' function. */
#undef HAVE_PTHREAD_YIELD
with_gssapi
with_randomdev
enable_threads
+with_locktype
with_libtool
enable_native_pkcs11
with_openssl
--with-geoip=PATH Build with GeoIP support (yes|no|path)
--with-gssapi=PATH Specify path for system-supplied GSSAPI [default=yes]
--with-randomdev=PATH Specify path for random device
+ --with-locktype=ARG Specify mutex lock type (adaptive or standard)
--with-libtool use GNU libtool
--with-openssl=PATH Build with OpenSSL yes|no|path.
(Crypto is required for DNSSEC)
fi
+
+# Check whether --with-locktype was given.
+if test "${with_locktype+set}" = set; then :
+ withval=$with_locktype; locktype="$withval"
+else
+ locktype="adaptive"
+fi
+
+
+ case "$locktype" in
+ adaptive)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_ADAPTIVE_NP" >&5
+$as_echo_n "checking for PTHREAD_MUTEX_ADAPTIVE_NP... " >&6; }
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define _GNU_SOURCE
+ #include <pthread.h>
+
+int
+main ()
+{
+
+ return (PTHREAD_MUTEX_ADAPTIVE_NP);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using adaptive lock type" >&5
+$as_echo "using adaptive lock type" >&6; }
+
+$as_echo "#define HAVE_PTHREAD_MUTEX_ADAPTIVE_NP 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using standard lock type" >&5
+$as_echo "using standard lock type" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ standard)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using standard lock type" >&5
+$as_echo "using standard lock type" >&6; }
+ ;;
+ *)
+ as_fn_error $? "You must specify \"adaptive\" or \"standard\" for --with-locktype." "$LINENO" 5
+ ;;
+ esac
+
for ac_header in sched.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
echo "Configuration summary:"
echo "------------------------------------------------------------------------"
echo "Optional features enabled:"
-$use_threads && echo " Multiprocessing support (--enable-threads)"
+if $use_threads; then
+ echo " Multiprocessing support (--enable-threads)"
+ if test "$enable_full_report" = "yes" -o "$locktype" = "standard"; then
+ echo " Mutex lock type: $locktype"
+ fi
+fi
test "$use_tuning" = "large" && echo " Large-system tuning (--with-tuning)"
test "$use_geoip" = "no" || echo " GeoIP access control (--with-geoip)"
test "$use_gssapi" = "no" || echo " GSS-API (--with-gssapi)"
# Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC")
+
# Copyright (C) 1998-2003 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
AC_CHECK_FUNC(pthread_attr_setstacksize,
AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
+ AC_ARG_WITH(locktype,
+ [ --with-locktype=ARG Specify mutex lock type (adaptive or standard)],
+ locktype="$withval", locktype="adaptive")
+
+ case "$locktype" in
+ adaptive)
+ AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #define _GNU_SOURCE
+ #include <pthread.h>
+ ]], [[
+ return (PTHREAD_MUTEX_ADAPTIVE_NP);
+ ]])],
+ [ AC_MSG_RESULT(using adaptive lock type)
+ AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
+ [Support for PTHREAD_MUTEX_ADAPTIVE_NP]) ],
+ [ AC_MSG_RESULT(using standard lock type) ])
+ ;;
+ standard)
+ AC_MSG_RESULT(using standard lock type)
+ ;;
+ *)
+ AC_MSG_ERROR([You must specify "adaptive" or "standard" for --with-locktype.])
+ ;;
+ esac
+
AC_CHECK_HEADERS(sched.h)
case "$host" in
echo "Configuration summary:"
echo "------------------------------------------------------------------------"
echo "Optional features enabled:"
-$use_threads && echo " Multiprocessing support (--enable-threads)"
+if $use_threads; then
+ echo " Multiprocessing support (--enable-threads)"
+ if test "$enable_full_report" = "yes" -o "$locktype" = "standard"; then
+ echo " Mutex lock type: $locktype"
+ fi
+fi
test "$use_tuning" = "large" && echo " Large-system tuning (--with-tuning)"
test "$use_geoip" = "no" || echo " GeoIP access control (--with-geoip)"
test "$use_gssapi" = "no" || echo " GSS-API (--with-gssapi)"
char strbuf[ISC_STRERRORSIZE];
isc_result_t result = ISC_R_SUCCESS;
int err;
+#ifdef HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
+ pthread_mutexattr_t attr;
+ if (pthread_mutexattr_init(&attr) != 0)
+ return (ISC_R_UNEXPECTED);
+ if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP) != 0) {
+ pthread_mutexattr_destroy(&attr);
+ return (ISC_R_UNEXPECTED);
+ }
+ err = pthread_mutex_init(mp, &attr);
+#else /* HAVE_PTHREAD_MUTEX_ADAPTIVE_NP */
err = pthread_mutex_init(mp, ISC__MUTEX_ATTRS);
+#endif /* HAVE_PTHREAD_MUTEX_ADAPTIVE_NP */
+
if (err == ENOMEM)
return (ISC_R_NOMEMORY);
if (err != 0) {