Skip site navigation (1)Skip section navigation (2)
Date:      23 Aug 1999 17:23:03 +0300
From:      Ville-Pertti Keinonen <will@iki.fi>
To:        grog@lemis.com (Greg Lehey)
Cc:        hackers@freebsd.org
Subject:   Re: Mandatory locking?
Message-ID:  <86zoziwp88.fsf@not.demophon.com>
In-Reply-To: grog@lemis.com's message of "23 Aug 1999 11:16:18 %2B0300"
References:  <19990823162813.I83273@freebie.lemis.com> <19990823174345.J83273@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help

grog@lemis.com (Greg Lehey) writes:

> Again, if we have two concurrent transactions, we stand to gain money:
> the updated balance is likely not to know about the other transaction,
> and will thus "forget" one of the deductions.

> Now I suppose you're going to come and say that this is bad
> programming, and advisory locking would do the job if the software is
> written right.  Correct.  You could also use the same argument to say
> that memory protection isn't necessary, because a correctly written
> program doesn't overwrite other processes address space.  It's the

The difference is that if a program has privileges to screw up
whatever you are protecting, it can do so even if you do have
mandatory locking, simply by functioning incorrectly when it does gain
access to the data.

And even without otherwise incorrect behavior, if you have a program
that doesn't use any locking and another one that uses mandatory
locking to prevent races with the non-locking program, the mere
existence of the locking program does not prevent multiple non-locking
programs from generating similar conditions.

(I'm not opposed to mandatory locking in principle, but I don't find
your reasoning very convincing.)


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?86zoziwp88.fsf>