Sidebar re locks vs warnings (was Re: dvfs api and toolkits)

David Collier-Brown David.Collier-Brown at Sun.COM
Sat Apr 9 23:06:53 EEST 2005


Nate Nielsen wrote:
> This isn't a particularly new problem. Your OS doesn't give you an error
>  in this case. It's up to the application to be aware of multiple users,
> and use some sort of locking. [1]

Note that Unix was written with only one form of atomic
filesystem operation, open/creat, rather than a suite of
locking mechanisms, despite other OSs having rich 
systems of locks.  

The authors expected the authors of applications such as
text editors to save the state (with fstat) of the file
after opening it, and compare it before writing. The
application is expected to say something like

	This file has changed since you opened it, possibly
	by another copy of the editor. To discard your changes,
	execute "quit". To overwrite the file with your
	changes, execute "write".
 
> Basically almost every single method of accessing files system has this
> problem. Sure some support locking (like smb and nfs) but even then it's
> up to the application to be aware and use it. FTP, HTTP, all currently
> have this problem even without bringing a VFS into the picture.
> 
> It's admirable to try and take on this ubiquitous problem. But if DVFS
> feels it should address it, then I think it should do so in a competent
> and complete manner and not just toss out 'seeking' (on reads, no less)
> because of these already present issues.

	This approach might be appropriate if you're modifying the
	file, and rereading will suffice if you're just reading it.

--dave
-- 
David Collier-Brown,      | Always do right. This will gratify
Sun Microsystems, Toronto | some people and astonish the rest
davecb at canada.sun.com     |                      -- Mark Twain



More information about the xdg mailing list