From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16877 invoked by alias); 19 Dec 2009 00:49:01 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27535 Received: (qmail 18228 invoked from network); 19 Dec 2009 00:48:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,TVD_RCVD_IP autolearn=no version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at fruitbat.org does not designate permitted sender hosts) Date: Fri, 18 Dec 2009 16:48:02 -0800 (PST) From: "Peter A. Castro" To: zsh-workers@zsh.org cc: zsh-users@zsh.org Subject: Re: Unable to read history on latest Cygwin In-Reply-To: <733654e30912171119v16378e1el494468c1e0e4838e@mail.gmail.com> Message-ID: References: <1260800369.32429.1350005931@webmail.messagingengine.com> <733654e30912160754q5e505cabo4a2510b41bf1d892@mail.gmail.com> <733654e30912171119v16378e1el494468c1e0e4838e@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 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 or "Cats are just autistic Dogs" -- Dr. Tony Attwood