httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: Additional serialization code [Jim Jagielski <jim@shado.jaguNET.com>] (fwd)
Date Tue, 08 Aug 1995 10:01:01 GMT
On review of this code, it's got a bit of a problem --- locks reserved
by flock() are per-descriptor, *not* per-process (with fcntl, it's the
reverse).  Since all server processes share a single descriptor with the
error log, what happens is that the first process to execute flock()
grabs the lock (against any other descriptor which may have been
obtained by a different open()) call, and all subsequent flock() calls
--- in the same process or a different one --- simply verify that the
lock is still held and return (which is very fast, but, unfortunately,
does nothing at all about mutual exclusion).

This *would* work on linux pre-1.3, in which flock had the same semantics
as fcntl locks (widely considered a bug), or using the scoreboard descriptor,
since each child process *does* have a distinct one of those.

rst

PS --- since this works for Jim anyway, I consider that confirmation that
   no form of locking is actually required around the accept() in A/UX.


Mime
View raw message