Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Aug 1999 23:27:27 -0400
From:      Christopher Masto <chris@netmonger.net>
To:        Chuck Robey <chuckr@picnic.mat.net>
Cc:        Garance A Drosihn <drosih@rpi.edu>, "Daniel C. Sobral" <dcs@newsguy.com>, Greg Lehey <grog@lemis.com>, Poul-Henning Kamp <phk@critter.freebsd.dk>, Matthew Dillon <dillon@apollo.backplane.com>, FreeBSD Hackers <hackers@FreeBSD.ORG>, FreeBSD Committers <cvs-committers@FreeBSD.ORG>, Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Subject:   Re: Mandatory locking?
Message-ID:  <19990823232726.B16133@netmonger.net>
In-Reply-To: <Pine.BSF.4.10.9908232313540.49952-100000@picnic.mat.net>; from Chuck Robey on Mon, Aug 23, 1999 at 11:16:21PM -0400
References:  <19990823231130.A16133@netmonger.net> <Pine.BSF.4.10.9908232313540.49952-100000@picnic.mat.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 23, 1999 at 11:16:21PM -0400, Chuck Robey wrote:
> On Mon, 23 Aug 1999, Christopher Masto wrote:
> 
> > Bleah.. I can't count the number of times I've seen idiotic code like:
> > 
> > open file
> > read data
> > close file
> > open file for write
> > write data
> > close file
> > 
> > Mandatory locking of the type above doesn't force such a thing to work.
> 
> What has that code you show above got to do with mandatory locking?
> You completely missed the explicit locking calls that you have to make,
> to get and release the locks.  If you don't make the call, and you have
> madatory locking, then your process will sleep until someone else
> releases the lock;

Exactly.  You said that mandatory locking means that user A's correct
use of locking means that user B doesn't have to be careful.  That's
not the case, since A can step in between B's read and write.  A's
mandatory lock doesn't help.

I don't see the use for it.
-- 
Christopher Masto         Senior Network Monkey      NetMonger Communications
chris@netmonger.net        info@netmonger.net        http://www.netmonger.net

Free yourself, free your machine, free the daemon -- http://www.freebsd.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990823232726.B16133>