dvfs locking

Sean Middleditch elanthis at awesomeplay.com
Sat Mar 5 07:02:45 EET 2005


On Sat, 2005-03-05 at 01:25 +0100, Waldo Bastian wrote:

> I'm not aware of any KDE application that does any form of locking on its 
> documents. We do locking on config files to ensure atomic "read-update-write" 
> cycles there. Most KDE applications use atomic writes (write+rename) to write 
> their documents. Some applications check modification dates before writing 
> back changes.

I'm considering config files outside the D-VFS domain, since pure POSIX
or GConf/KConfig should be used there.  Atomic writes make sense
whenever they are possible.  "Begin atomic write if not newer than
<timestamp>" seems like it could be a useful operation.

> 
> > It's not so much weather D-VFS will do locking or not, but how it will
> > do it.  If desktop apps do locking for atomic writes, then it makes a
> > hell of a lot more sense to just make write operations atomic if it's at
> > all possible and not requires applications to explicitly lock and unlock
> > the file during a write.  If applications use locking for versioning
> > purpose, where that's only even available on a limited number of
> > protocols/filesystems, it would make more sense to add a versioning API
> > versus making apps do a bunch of the details manually.
> >
> > Do keep in mind that locking is not a supportable feature on many
> > protocols, so any case where locking would be used will still have to be
> > optional in all applications, since it isn't even emulatable on many
> > protocols.
> >
> > Looking forward to your feedback and wisdom, everyone.  ;-)
> 
> I think some "write if file has not changed or fail otherwise" semantic could 
> be useful. That way you can ensure the integrity of a "read-update-write" 
> cycle. (Is that what you mean with versioning API?)

For versioning I more meant the actual multiple-versions-of-a-document
style operation that some protocols (such as DAV - the 'V' is for
Versioning) are made to support.  Certain siblings/ancestors of UNIX
also natively supported versioning, if I recall.  Basically think of a
file system that works like CVS/Subversion - every write is an atomic
operation that creates a whole new copy of the document, but does not
destroy the old copy.  You can review old revisions or rollback the
document.

It's not at all commonly used, and for many good reasons, but it is one
of the specialty niches where D-VFS could be very useful, and it's
something I can easily imagine the corporate-types being happy to have,
were it available and easily usable with major desktop applications.

> 
> Cheers,
> Waldo
-- 
Sean Middleditch <elanthis at awesomeplay.com>




More information about the xdg mailing list