Re: On file locking

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Giles Lean <giles(at)nemeton(dot)com(dot)au>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On file locking
Date: 2003-02-02 07:31:47
Message-ID: 9708.1044171107@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Giles Lean <giles(at)nemeton(dot)com(dot)au> writes:
> Boring reference material follows.

Couldn't help noticing that you omitted HPUX ;-)

On HPUX 10.20, flock doesn't seem to exist (hasn't got a man page nor
any mention in /usr/include). lockf says

All locks for a process are released upon
the first close of the file, even if the process still has the file
opened, and all locks held by a process are released when the process
terminates.

and

When a file descriptor is closed, all locks on the file from the
calling process are deleted, even if other file descriptors for that
file (obtained through dup() or open(), for example) still exist.

which seems to imply (but doesn't actually say) that HPUX keeps track of
exactly which process took out the lock, even if the file is held open
by multiple processes.

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2003-02-02 08:55:53 COUNT and Performance ...
Previous Message mail.luckydigital.com 2003-02-02 06:18:59 7.2 result sets and plpgsql