zsh-workers
 help / color / mirror / code / Atom feed
From: "Peter A. Castro" <doctor@fruitbat.org>
To: zsh-workers@zsh.org
Cc: zsh-users@zsh.org
Subject: Re: Unable to read history on latest Cygwin
Date: Fri, 18 Dec 2009 16:48:02 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0912181641210.19572@gremlin.fruitbat.org> (raw)
In-Reply-To: <733654e30912171119v16378e1el494468c1e0e4838e@mail.gmail.com>

On Thu, 17 Dec 2009, Wayne Davison wrote:

[appologies for cross-posting to both lists.  I wanted to ensure this
thread carried over to zsh-workers where PeterS. moved it to, if there
are future discussions.]

> On Thu, Dec 17, 2009 at 12:04 AM, Peter A. Castro <doctor@fruitbat.org>wrote:
>
>> Hmm...atomic in the sense that the open vectors through the symlink to the
>> real file?
>>
>
> No, atomic as in no two people can think they were successful in creating it
> -- one must succeed, and everyone else must fail.  A file created
> *without*O_EXCL succeeds for everyone, but sadly, O_EXCL does not always work
> correctly (e.g. older NFS don't always support it). Thus, what matters is if
> the chosen idiom can safely be used as a single-success locking method or
> not.  For O_EXCL, cygwin just needs to have implemented that right.  For
> symlinks, it will depend on how the creating of the (symlink-emulating) file
> is created in the cygwin code.

Ah, I understand.  Cygwin relies on the underlying mechanisms available
from MS Windows file API.  From reviewing Cygwin code, it appears it is
using the native support for exclusive file locking, so, I beleve that,
yes, it does what you want (ie: only one process can exclusively open a
file using O_EXCL).

Creating symlinks, however, may not be atomic.  I'll have to check code
on that, but the symlink is really just an ordinary file.  I'll have to
check weither it's created with exclusive locks or not.

> ..wayne..

-- 
Peter A. Castro <doctor@fruitbat.org> or <Peter.Castro@oracle.com>
 	"Cats are just autistic Dogs" -- Dr. Tony Attwood


      parent reply	other threads:[~2009-12-19  0:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1260800369.32429.1350005931@webmail.messagingengine.com>
     [not found] ` <733654e30912160754q5e505cabo4a2510b41bf1d892@mail.gmail.com>
     [not found]   ` <733654e30912171200g1f135030j5d3f978648caca70@mail.gmail.com>
2009-12-18 10:25     ` Peter Stephenson
     [not found]   ` <Pine.LNX.4.64.0912162357250.19572@gremlin.fruitbat.org>
     [not found]     ` <733654e30912171119v16378e1el494468c1e0e4838e@mail.gmail.com>
2009-12-19  0:48       ` Peter A. Castro [this message]

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=Pine.LNX.4.64.0912181641210.19572@gremlin.fruitbat.org \
    --to=doctor@fruitbat.org \
    --cc=zsh-users@zsh.org \
    --cc=zsh-workers@zsh.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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).