X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=jgROKaEoNU/JzqCCyCx62YF3ck9EgujhmEGQMeC+mUp6Mmh/LEKRU
	ZBCwWprUO4CmD0xn1mgMymXeU+KCz3ARk/Rz+mtSZfuu40Iybq2bQAZHdkZ82ot8
	LO2DnwwNQl7/nDrDo9u1j0ZoAeHJvTzgmTQerdzhLHM9CXjif72o2c=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=TQMlLFVv9xfuCCmmlM76wbpdegk=; b=h4Sxd3Ac898hRbapLoNkTxndwJh2
	9SC80bAdVfMuOvxMfY/Ub+ekU4g+2AsQZZIBSOLsKUeaOluH1Nu7oQbX/xy/XkpI
	iEtAb67j+1FNj4xJLeeVlSLFSbFXHJ68Sp+SYH/elUkCPu0pszTLp4m8kZ9Em+s1
	8lBHG5M0nxLnLY8=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,TW_FC autolearn=ham version=3.3.1
Date: Sat, 1 Jun 2013 13:35:31 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: sqlite3: bug with monotone
Message-ID: <20130601113531.GE30659@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <51A6B6EB.6050309@users.sourceforge.net> <loom.20130530T122354-144@post.gmane.org> <51A7862F.1070507@etr-usa.com> <51A7D47E.3050502@users.sourceforge.net> <51A7F547.6020509@etr-usa.com> <20130531092228.GB30659@calimero.vinschen.de> <51A900EF.2020606@etr-usa.com> <20130601105741.GC30659@calimero.vinschen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20130601105741.GC30659@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)

On Jun  1 12:57, Corinna Vinschen wrote:
> There's a lot to recommend not using mandatory locking at all, unless in
> very limited circumstances where interoperability with native
> applications using mandatory locking is required.  For one thing, this
> doesn't occur very often, since mandatory record locking isn't used
> a lot, not even on Windows.  But what's more important is that Windows
> mandatory record locking works not as the user can usually expect from
> fcntl or flock: Windows locks are per-process/per-handle.  Locks are not
                                    ^^^^^^^^^^^^^^^^^^^^^^

Make that "per-process/per-file object".

To clarify: The file object is the OS datastructure the handles refer
to.  A duplicated handle refers to the same file object, while a handle
to the same file created with CreateFile refers to another file object.

Duplicated handles within the same process share the locks.  Different
handles to the same file created with CreateFile don't share the locks.

Duplicated handles to the same file object in another process (via
inheritance or an explicit DuplicateHandle) don't share the locks.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

