What are some arguments against locking?

Matt Mackall mpm at selenic.com
Wed Jun 25 14:52:56 CDT 2008


On Wed, 2008-06-25 at 15:00 -0400, Paul Chiusano wrote:
> Hi,
> 
> I am currently evaluating Mercurial for use at my company, where we
> currently use StarTeam (gak!). One of my coworkers seems to think that
> locking is a very useful feature and that it is a nonstarter to even
> consider a VCS without it. Although I disagree strongly with this, I
> haven't been too successful in convincing him, so I thought I would
> ask people here for some additional arguments for why locking is not
> usually useful. 
> 
> For context, my coworker's basic argument is that sometimes people
> make changes to the same file and the changes are difficult to merge,
> requiring hours of work to figure out what the merged changes should
> look like. Even if this is relatively infrequent, it's enough of a
> time sink to make it worth preventing it entirely by locking. How do
> other people avoid situations like this when using Mercurial? Note
> that I am NOT saying I agree with this argument at all, I just wanted
> to have some additional perspectives on this so that I can explain
> things a bit better.

a) Locking doesn't scale. Mercurial is designed for large projects with
hundreds or thousands of users.

b) Locking is not possible in a disconnected system and Mercurial is
such a system.

c) Most of the world moved away from locking ages ago. That's why the
'C' in CVS stands for 'concurrent'. Not locking was its big exciting new
feature.

Projects much bigger than yours get by just fine without locking. For
some perspective on this, look at the Linux kernel development process.
During their 'merge window', they'll usually merge about 8000 changesets
from about 1000 contributors, touching most of the files in the kernel
in a two week period. The amount of code that gets changed in that
window is comparable to the size of the entire 1.0 version of the
kernel.

If instead, 1000 people had to sit on their thumbs waiting for
permission to modify Makefile, they'd use their now-copious free time to
write a lockless system.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list