Re: On file locking

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Giles Lean <giles(at)nemeton(dot)com(dot)au>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On file locking
Date: 2003-02-02 19:27:28
Message-ID: Pine.NEB.4.51.0302030423260.509@angelic.cynic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

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. (So you don't, e.g.,
test a local filesystem but end up with data on an NFS filesystem with
different locking semantics.) That's what procmail does.

Given this, I'm not even sure the whole idea is worth persuing. (Though
I guess I should find out what NetBSD is really doing, and fix the
manual pages correspond to reality.)

cjs
--
Curt Sampson <cjs(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kurt Roeckx 2003-02-02 19:35:20 pg_hba.conf hostmask.
Previous Message Tom Lane 2003-02-02 19:23:35 Re: Linux.conf.au 2003 Report