This is the mail archive of the
mailing list for the Cygwin project.
Re: Unreliable flock
- From: Warren Young <wyml at etr-usa dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 4 Apr 2016 13:24:03 -0600
- Subject: Re: Unreliable flock
- Authentication-results: sourceware.org; auth=none
- References: <175808986 dot 20160403002257 at yandex dot ru> <20160404151644 dot GB29337 at calimero dot vinschen dot de> <59768064 dot 20160404195111 at yandex dot ru>
On Apr 4, 2016, at 10:51 AM, Andrey Repin <firstname.lastname@example.org> wrote:
>> BSD file locks created via flock are only propagated to the direct parent
> that's a showstopper. In short, it makes the function literally useless.
Nonsense. Thatâs only true if âliterallyâ every program that uses BSD locks creates grandchildren that also need to use those same locks.
I know of one program for certain that uses BSD locks under Cygwin that doesnât create grandchildren, and its extensive test suite passed with Cygwin/BSD locks the last time I ran it.
> Why they aren't real locks? What's use for "advisory locksâ?
âRealâ locks are generally not what you want when running purely Unix/Linux software under Cygwin, because thatâs not what you get by default on Linux or Unix. You have to go out of your way to get mandatory locking on POSIX systems, as a rule.
Mandatory locks arenât purely positive. Theyâre the single biggest reason Windows still needs a reboot for many kinds of upgrades, while Linux generally only has to be rebooted for kernel or glibc upgrades, and the latter is, strictly speaking, optional.
> "I think I may
> have a use for this file, but you are free to delete it, if you wishâ ?
Among cooperating processes, thatâs perfectly fine.
Consider SQLite. On a system where SQLite decides to use some form of advisory locking, the primary risk of damage isnât rm or dd, itâs another copy of SQLite coming along and writing to the DB while the first is in the middle of a transaction,.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple