apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject [PATCH] Switch ordering of interprocess mutex decisions again...
Date Sat, 07 Jul 2001 07:16:55 GMT
Aaron showed me in Stevens Vol. 2 (Appendix A, I believe) about the 
performance analysis of interprocess mutexes and their various speeds.

Let's just say that Stevens refused to graph fcntl for Solaris 2.6.
The pthread mutex remained constantly low even at ~8 threads (highest 
number Stevens went up to).  pthread mutex was also the fastest 
interprocess mutex implementation on Solaris.

I'd like to commit this - this restores the order we had originally.
If pthread_mutex_t satisfies the condition for being an interprocess
mutex, it will be the "best" choice.  With Jeff's addition to check 
for the existance of /dev/zero and my check for an actually working 
PTHREAD_PROCESS_SHARED, this seems like a good thing to start trying to
get right.  

If no one has said anything negative by the end of the weekend (i.e. 
Monday morning - which should hopefully give Jeff a chance to get in 
the office and read email before I wake up), I'll commit.

Once we get shmem rewritten (after SMS settles down?), we can revisit 
the mmap of /dev/zero hack in our usage of pthread_mutex_t.

I'm just not sold on fcntl.  If someone wants to tell me that fcntl will
scale better than pthread mutex, I'd love to be enlightened.  -- justin

Index: configure.in
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.329
diff -u -r1.329 configure.in
--- configure.in	2001/07/07 06:53:16	1.329
+++ configure.in	2001/07/07 06:58:24
@@ -987,12 +987,12 @@
             APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
 APR_IFALLYES(func:flock define:LOCK_EX,
             APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()]))
+APR_IFALLYES(header:fcntl.h define:F_SETLK,
+            APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
 # note: the current APR use of shared mutex requires /dev/zero
 APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
             func:pthread_mutexattr_setpshared file:/dev/zero,
             APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex]))
-APR_IFALLYES(header:fcntl.h define:F_SETLK,
-            APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
 if test "x$apr_lock_method" != "x"; then

View raw message