[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

transactions, locks, filesystems (was: The /. article)

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-02-06 03:58:41 CET

On Tue, Feb 05, 2002 at 06:47:13PM -0800, Blair Zajac wrote:
> Zack Weinberg wrote:
> > I would point out that it is quite difficult to implement an atomic
> > transaction model on top of bare Unix filesystem primitives, and even
> > harder on Windows due to the lack of hard links. Use of a database
> > gets Subversion atomicity for free.
> I've always used mkdir() to create locks for both Windows and Unix. Is
> there any reason (beyond slowness) that they are used instead of hard
> links?

I think the issue is building a transaction. You want to refer to the
original stuff (using a link), add some new stuff, and when complete:
install it. Only at the very end of that would the lock be used (unless, of
course, you locked down the whole repository while performing the

It certainly is possible to build all that up using file system primitives,
such as mkdir() to perform a lock, but hoo... it could get quite burdensome.
And the performance? And if you missed a race condition somewhere?

Berkeley handles it for us, and it does it very quickly (multi-process lock
management is done via shared memory). And we didn't have to worry about it
at all :-)


Greg Stein, http://www.lyra.org/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:04 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.