httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: [PATCH] SysV semaphores
Date Wed, 06 Aug 1997 14:49:09 GMT
marcs@alive:/tmp$ ./time-FCNTL 10 40000
marcs@alive:/tmp$ ./time-FLOCK 10 40000
marcs@alive:/tmp$ ./time-SEM 10 40000

P166, FreeBSD 2.1.  Note I had to remove your declaration of the semun
(nice name) union to make it compile.

pthreads one just don't compile (well, it shouldn't on 2.1 and doesn't on
2.2), although I may be able to make it try by manually doing the pthreads

Oh, BTW, once I got a:

WTF! shared_counter != 0 before the children have been started!

using flock.

On Wed, 6 Aug 1997, Dean Gaudet wrote:

> Ok, here's some data.  The test machine is running solaris 2.5.1 and has
> two processors: 
> cpu0: SUNW,UltraSPARC (upaid 0 impl 0x10 ver 0x40 clock 168 MHz)
> cpu1: SUNW,UltraSPARC (upaid 1 impl 0x10 ver 0x22 clock 168 MHz)
> The timing program is below.  I timed fcntl, sysv semaphores, and posix
> mutexes (posix pthread mutexes apply to processes as well as threads, so
> say the docs). 
> I ran 10 children, with varying numbers of iterations.  And the
> lock/unlock op times averaged out to:
> fcntl 45 us
> sysv  25 us
> posix 1.5 us
> And to make things even better, the posix stuff has far fewer gotchas than
> sysv semaphores.  Essentially no gotchas, it just takes a mmap(). 
> Linux pthreads don't seem to implement inter-process locking (or I screwed
> up trying to get the right type of shared memory).  But for the other
> three types, sysv is the slowest, then fcntl, and flock is the fastest. We
> currently use fcntl on linux, switching to flock would be a nice thing. 
> Someone want to time FreeBSD, or anything else that warrants it for that
> matter. 

View raw message