all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Locking files for CLASH_DETECTION now supported on MS-Windows
Date: Tue, 26 Feb 2013 14:34:29 -0800	[thread overview]
Message-ID: <512D3875.5020307@cs.ucla.edu> (raw)
In-Reply-To: <834ngzhrdf.fsf@gnu.org>

On 02/26/13 10:17, Eli Zaretskii wrote:

> We could avoid this by teaching Emacs on Posix systems to
> read lock files created by Emacs running on Windows.

I don't see how to do this without introducing race
conditions that are not present in the current GNU/Linux
implementation.  There are atomic system calls to create,
test, and remove symbolic links, but the corresponding
syscalls do not exist directly for regular files, and would
need to be implemented carefully.  Doing this portably and
reliably, in a way where the MS-Windows and non-MS-Windows
approaches work together, will take some work.

> We could also strengthen this by considering a file locked
> just because the .#FOO lockfile exists

Other applications (i.e., not GNU Emacs) create regular
files .#FOO, and Emacs shouldn't be impeded from editing FOO
merely because some other application has created .#FOO.  (We
could try to parse .#FOO but this leads to races.)

> Another possibility would be to make Emacs running on Windows avoid
> locking files on remote filesystems.

Won't there still be a problem if the local file system is
exported?  MS-Windows Emacs will use Windows-style locking
on the local file system, and this might confuse
non-MS-Windows Emacs accessing the same file.

> Are there any other scenarios we should consider?

To move things forward, I propose that the MS-Windows
implementation use a different lock file name .#-FOO.  (The
'-' is because '-' is not commonly used as the first
character of a file name.)  MS-Windows and non-MS-Windows
instances will ignore each others' locks.  This avoids the
race conditions mentioned earlier, and it will mean
that MS-Windows instances won't mess up non-MS-Windows
instances.  It has the downside that MS-Windows and
non-MS-Windows instances will ignore each others' locks,
but that's better than where we are now.

If we can come up with a reliable scheme whereby MS-Windows
and non-MS-Windows Emacs versions can both use the same lock
file name, we can unify the two approaches, but for now
using different names is a simple fix that should make
GNU/Linux Emacs locking reliable again.

A patch to implement this proposal is in
<http://bugs.gnu.org/13807#14>.



  reply	other threads:[~2013-02-26 22:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 17:43 Locking files for CLASH_DETECTION now supported on MS-Windows Eli Zaretskii
2013-02-25 18:05 ` Paul Eggert
2013-02-25 18:41   ` Eli Zaretskii
2013-02-25 18:56     ` Paul Eggert
2013-02-26  2:03       ` Paul Eggert
2013-02-26  2:43         ` Daniel Colascione
2013-02-26  3:23           ` Paul Eggert
2013-02-26  4:02         ` Eli Zaretskii
2013-02-26  4:28           ` Daniel Colascione
2013-02-26 17:45             ` Eli Zaretskii
2013-02-26  6:05           ` Paul Eggert
2013-02-26 18:41             ` Eli Zaretskii
2013-02-26 18:51               ` Eli Zaretskii
2013-02-26  4:00       ` Eli Zaretskii
2013-02-26  5:46         ` Paul Eggert
2013-02-26 18:02           ` Eli Zaretskii
2013-02-26 18:17       ` Eli Zaretskii
2013-02-26 22:34         ` Paul Eggert [this message]
2013-02-27  4:01           ` Eli Zaretskii
2013-02-27  7:45             ` Paul Eggert
2013-02-27 19:02               ` Eli Zaretskii
2013-02-27 19:01           ` Eli Zaretskii
2013-02-25 19:39     ` Glenn Morris
2013-02-25 19:43       ` Eli Zaretskii
2013-02-25 20:35   ` Stefan Monnier
2013-02-25 22:49     ` Paul Eggert
2013-02-26  3:49       ` Eli Zaretskii
2013-02-26 12:56       ` Richard Stallman
2013-02-26  3:40     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=512D3875.5020307@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.