On Wed, 2004-05-26 at 13:41, Ben Collins-Sussman wrote:
> > With no transaction-based consistency protection?
>
> Write to a tmpfile, then move it.
It's not *quite* that simple. If you and I are both trying to lock
(different) files at the same time, then we could run into a race. (You
read, I read, you write, I write, and your lock is omitted.) If the
tmpfile always has the same name and is opened with O_EXCL, then one of
us will fail to open the tmpfile, which means there would have to be a
retry loop.
Another non-DB technique would be to have a directory tree of the locked
files. That would scale better in some ways and would eliminate the
possibility of multiple people interfering with each other by locking
different files, but it would mean checking a to-be-committed
transaction against the lock table would be slower. (We could probably
use directory pruning techniques to make it pretty fast, though.)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 26 21:57:42 2004