summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-05-11 07:59:08 +0000
committerHavoc Pennington <hp@redhat.com>2003-05-11 07:59:08 +0000
commitab10ae902d8aa7c2b98fd080a7458127b1b8e648 (patch)
treeb566d610ee13aa1a4ab9013eb7d19eb3dd7ad1c8 /configure.in
parent27b694f6e109c78c633ddb8d96f524e46e536f4e (diff)
2003-05-11 Havoc Pennington <hp@pobox.com>
Write a "test-profile" that does echo client-server with threads; profile reveals lock contention, memcpy/realloc of buffers, and UTF-8 validation as hot spots. 20% of lock contention eliminated with dbus_atomic_inc/dec implementation on x86. Much remaining contention is global mempool locks for GList and DBusList. * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): add x86 implementation * dbus/dbus-connection.c (struct DBusConnection): use dbus_atomic_t for the reference count * dbus/dbus-message.c (struct DBusMessage): declare dbus_atomic_t values as volatile * configure.in: code to detect ability to use atomic integer operations in assembly, from GLib patch * dbus/dbus-internals.c (_dbus_verbose_real): call getpid every time, tired of it being wrong in threads and forked processes * glib/test-profile.c: a little program to bounce messages back and forth between threads and eat CPU * dbus/dbus-connection.c: add debug spew macros for debugging thread locks; include config.h at top; fix deadlock in dbus_connection_flush()
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 18cb519e..f95da565 100644
--- a/configure.in
+++ b/configure.in
@@ -205,6 +205,28 @@ AC_SUBST(DBUS_HAVE_INT64)
## byte order
AC_C_BIGENDIAN
+#### Atomic integers (checks by Sebastian Wilhelmi for GLib)
+AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
+have_atomic_inc=no
+if test x"$GCC" = xyes; then
+ case $host_cpu in
+ i386)
+ AC_MSG_RESULT([no])
+ ;;
+ i?86)
+ AC_MSG_RESULT([i486])
+ AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
+ have_atomic_inc=yes
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+if test x$have_atomic_inc = xyes ; then
+ AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
+fi
+
#### Various functions
AC_CHECK_LIB(socket,socket)
AC_CHECK_LIB(nsl,gethostbyname)
@@ -598,6 +620,7 @@ else
TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
fi
AC_SUBST(TEST_SOCKET_DIR)
+AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
if ! test -z "$with_session_socket_dir" ; then
DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"