Re: On file locking - Mailing list pgsql-hackers

From Giles Lean
Subject Re: On file locking
Date
Msg-id 353.1044223718@nemeton.com.au
Whole thread Raw
In response to Re: On file locking  (Curt Sampson <cjs@cynic.net>)
List pgsql-hackers
Curt Sampson <cjs@cynic.net> wrote:

> On Sun, 2 Feb 2003, Tom Lane wrote:
> 
> > This all doesn't look good for using file locks in the way I had in
> > mind :-( ... but considering that all these man pages seem pretty vague,
> > maybe some direct experimentation is called for.
> 
> Definitely. I wonder about the NetBSD manpage quotes in the post you
> followed up to, given that last time I checked flock() was implmented,
> in the kernel, using fcntl(). Either that's changed, or the manpages
> are unclear or lying.

Using the same kernel code != same semantics.

I think the NetBSD manual pages are trying to say that it's "safe" to
have lockf(), fcntl(), and flock() locking playing together.  That
needn't be the case on all operating systems and the standards don't
require it.

> This has been my experience in the past; locking semantics are subtle
> and unclear enough that you really need to test for exactly what you
> want at build time on every system, and you've got to do this testing
> on the filesystem you intend to put the locks on.

What he said ...

Giles


pgsql-hackers by date:

Previous
From: Jakub Ouhrabka
Date:
Subject: Re: Case Studio II
Next
From: Gavin Sherry
Date:
Subject: Re: Interactive Documentation - how do you want it to