emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Locking files for CLASH_DETECTION now supported on MS-Windows


From: Eli Zaretskii
Subject: Re: Locking files for CLASH_DETECTION now supported on MS-Windows
Date: Tue, 26 Feb 2013 19:45:45 +0200

> Date: Mon, 25 Feb 2013 20:28:35 -0800
> From: Daniel Colascione <address@hidden>
> CC: Paul Eggert <address@hidden>, address@hidden
> 
> If we really need atomicity under Windows, Transactional NTFS will work for 
> more
> users than symbolic links will.

No, I don't think we want Transactional NTFS (or TxF for short), for
several good reasons.

First, Microsoft itself is considering deprecating TxF, and strongly
recommends that developers use alternatives.  A quotation from
http://msdn.microsoft.com/en-us/library/windows/desktop/hh802690%28v=vs.85%29.aspx,
which speaks for itself:

  Abstract

  Microsoft strongly recommends developers investigate utilizing the
  discussed alternatives (or in some cases, investigate other
  alternatives) rather than adopting an API platform which may not be
  available in future versions of Windows.

  Introduction

  TxF was introduced with Windows Vista as a means to introduce atomic
  file transactions to Windows. It allows for Windows developers to have
  transactional atomicity for file operations in transactions with a
  single file, in transactions involving multiple files, and in
  transactions spanning multiple sources - such as the Registry (through
  TxR), and databases (such as SQL). While TxF is a powerful set of
  APIs, there has been extremely limited developer interest in this API
  platform since Windows Vista primarily due to its complexity and
  various nuances which developers need to consider as part of
  application development. As a result, Microsoft is considering
  deprecating TxF APIs in a future version of Windows to focus
  development and maintenance efforts on other features and APIs which
  have more value to a larger majority of customers.

Second, TxF is not really meant for atomicity in the sense that we are
looking for in this thread.  It is meant to preserve consistency in a
scenario of a catastrophic failure, such as an application or system
crash.  E.g., this page:

  
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365738%28v=vs.85%29.aspx

clearly says near its end that several writers to the same file --
exactly what bothers us here -- is not a supported scenario by TxF.
Read this page:

  
http://msdn.microsoft.com/en-us/library/windows/desktop/aa964931%28v=vs.85%29.aspx

to see how TxF is designed for scenarios that are very different from
what we are considering here.  E.g.:

  Reparse Points

  Changes to reparse points are transacted, which means that if a new
  reparse point gets assigned to a file in a transaction, it is not
  visible to the other transactions. Similarly, changes or removal of an
  existing reparse point are not visible until commit.

(NTFS symlinks are a kind of reparse point.)  This is exactly the
opposite of what we would like to happen.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]