httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: flock() question (fwd)
Date Fri, 28 Nov 1997 16:27:33 GMT
FYI, if using a FreeBSD box of recent 2.2 vintage and you don't need
accept locking to handle multiple Listen statements, you may (or may not)
get better performance with many children using SAFE_UNSERIALIZED_ACCEPT.

This is because for each accept() only one child is woken up, but whenever
a process fights for a flock(), they all wake up.

---------- Forwarded message ----------
Date: Fri, 28 Nov 1997 03:07:25 -0800
From: David Greenman <>
To: Marc Slemko <>
Cc: Charles Mott <>, hackers@FreeBSD.ORG
Subject: Re: flock() question 

>Hmm.  It looks like if you have multiple processes blocked on the
>same lock in FreeBSD (well, 2.2 anyway), they are all woken up when
>the lock is freed.  Yes, only one will get the lock but they will
>all be woken.  Unless I am reading the code wrong...  This is in
>contrast to multiple processes blocking in accept(), where only
>one will be woken up.

   The optimized wakeup case for accept() is that way because I optimized
it. :-) You're probably right about flock(), but I haven't gotten around to
looking at that and other potential wakeup optimizations. Changes like that
have to be made with great care...what seems obvious often doesn't turn out
that way. :-)


David Greenman
Core-team/Principal Architect, The FreeBSD Project

View raw message