public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Warren Young <warren@etr-usa.com>
To: cygwin@cygwin.com
Subject: Re: Options for getting mandatory locking in cygwin1.dll (was: Promote sqlite 3.7.13-1 from test status?)
Date: Thu, 16 Aug 2012 20:41:00 -0000	[thread overview]
Message-ID: <502D4F2F.5080306@etr-usa.com> (raw)
In-Reply-To: <20120816122654.GG17546@calimero.vinschen.de>

On 8/16/2012 6:26 AM, Corinna Vinschen wrote:
> On Aug 16 06:01, Warren Young wrote:
>> Advisory locking only works when all players cooperate.  We can't
>> assume that on Windows, unless we set up an insular Cygwin ghetto.
>
> So, are you saying that Cygwin should use mandatory file locking?

Of course not.  That would be a disaster.

> You are aware that there's no chance at all to implement the UNIX
> locking API calls correctly this way since Windows locking has nothing
> in common with UNIX locking except for the word "locking".

Not even on a per-process basis (cygwin_set_mandatory_locking(1)), in 
conjunction with fcntl(F_SETLK)?  That's how SQLite's unixFileLock() 
function is implemented.

That is, this proposal would put the DLL in a mode where it called 
LockFileEx() to establish the reader/writer lock byte ranges instead of 
using its private advisory locking scheme.

Alternately, Cygwin could follow Linux and implement 'mount -o mand'. 
You could get mandatory locking on just your svn checkout tree this way, 
for example.  It would apply to all Cygwin programs, not just 
svn/SQLite, but it shouldn't be any more problematic than normal day to 
day Windows use.  Cygwin programs not run within that mount wouldn't be 
affected.

I'm aware that fcntl(F_SETLK) isn't thread-safe[1] but we're arguing "if 
it's good enough for Unix, it's good enough for Cygwin" here, aren't we? 
  The other objection in reference [1] is that it doesn't work with NFS, 
which doesn't matter to us here, I think.

If neither of those proposals will work, I think we'll have no choice 
but to continue to try and chase a SQLite specific solution.  You can't 
fix it on the Windows native side of things.  I doubt you can fix it in 
Subversion, and even if you could, that's no better than fixing it in 
SQLite.  Worse, actually, because then you've got a fix that affects 
only one program, not all SQLite dependents.


[1] http://0pointer.de/blog/projects/locking.html

--
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

  parent reply	other threads:[~2012-08-16 19:52 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 17:20 [ANNOUNCEMENT] Updated: sqlite3-3.7.13-1 Warren Young
2012-08-16  3:38 ` Promote sqlite 3.7.13-1 from test status? (was: Updated: sqlite3-3.7.13-1) Warren Young
2012-08-16  4:56   ` Promote sqlite 3.7.13-1 from test status? Larry Hall (Cygwin)
2012-08-16  9:01   ` Promote sqlite 3.7.13-1 from test status? (was: Updated: sqlite3-3.7.13-1) Achim Gratz
2012-08-16  9:03     ` Corinna Vinschen
2012-08-16 11:06       ` Promote sqlite 3.7.13-1 from test status? Warren Young
2012-08-16 11:39         ` Corinna Vinschen
2012-08-16 12:48           ` Warren Young
2012-08-16 13:32             ` Corinna Vinschen
2012-08-16 14:32               ` Earnie Boyd
2012-08-16 16:20               ` Warren Young
2012-08-16 17:46                 ` Brian Wilson
2012-08-16 18:15                   ` David Rothenberger
2012-08-16 18:37                   ` Warren Young
2012-08-16 22:29                     ` James Johnston
2012-08-17  3:52                       ` Yaakov (Cygwin/X)
2012-08-17  3:56                         ` David Rothenberger
2012-08-17 20:03                         ` Brian Wilson
2013-02-05 19:51                         ` Achim Gratz
2013-02-11 20:07                           ` Warren Young
2013-02-11 21:24                             ` Achim Gratz
2013-02-11 21:51                               ` Warren Young
2013-02-11 22:00                                 ` Achim Gratz
2013-02-12  6:26                                   ` Warren Young
2013-02-12 17:54                                     ` Achim Gratz
2013-03-01 15:12                                     ` Achim Gratz
2013-03-01 22:52                                       ` Warren Young
2013-03-02  7:53                                         ` Achim Gratz
2013-02-11 22:49                                 ` David Stacey
2012-08-17 19:49                       ` Brian Wilson
2012-08-17  1:40                     ` JonY
2012-08-16 20:41               ` Warren Young [this message]
2012-08-17  9:45                 ` Options for getting mandatory locking in cygwin1.dll (was: Promote sqlite 3.7.13-1 from test status?) Corinna Vinschen
2012-08-17 14:25                   ` Andrey Repin
2012-08-17 15:52                   ` Options for getting mandatory locking in cygwin1.dll Warren Young
2012-08-16 15:06             ` Promote sqlite 3.7.13-1 from test status? Thrall, Bryan
2012-08-17  9:09             ` Andrey Repin
2012-11-17  5:15     ` Daniel Colascione
2012-08-16  9:04   ` Promote sqlite 3.7.13-1 from test status? (was: Updated: sqlite3-3.7.13-1) Adam Dinwoodie
2012-11-20 12:51 ` [ANNOUNCEMENT] Updated: sqlite3-3.7.13-1 Yaakov (Cygwin/X)
2012-11-21 18:43   ` Warren Young
2012-11-21 19:02     ` Achim Gratz
2012-11-23 22:13       ` Jon Lambert
2013-01-08 21:31       ` sqlite3-3.7.15.1-1 packages to test Warren Young
2013-01-08 21:36         ` Achim Gratz
2013-01-09 22:28         ` David Stacey
2013-01-10  0:08           ` Warren Young
2013-01-20  9:23         ` David Stacey
2013-01-20 10:45           ` Achim Gratz
2013-01-20 13:01             ` David Stacey
2013-02-06 22:44               ` David Stacey
2013-02-11 20:14                 ` Warren Young
2013-02-11 22:23                   ` David Stacey
2012-11-21 19:04     ` [ANNOUNCEMENT] Updated: sqlite3-3.7.13-1 Christopher Faylor
2012-11-21 19:40     ` David Stacey
2012-11-22 16:43       ` Christopher Faylor
     [not found] <CAJtt6BgReBuo=EBfujsLHB+xLW1E_POsdOayDfM_RtyuWRpJbg@mail.gmail.com>
2012-08-31 19:12 ` Fwd: Options for getting mandatory locking in cygwin1.dll (was: Promote sqlite 3.7.13-1 from test status?) Terris Linenbach
2012-09-02 10:59   ` Corinna Vinschen

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=502D4F2F.5080306@etr-usa.com \
    --to=warren@etr-usa.com \
    --cc=cygwin@cygwin.com \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).