Re: On file locking - Mailing list pgsql-hackers

From Tom Lane
Subject Re: On file locking
Date
Msg-id 9708.1044171107@sss.pgh.pa.us
Whole thread Raw
In response to Re: On file locking  (Giles Lean <giles@nemeton.com.au>)
Responses Re: On file locking
Re: On file locking
List pgsql-hackers
Giles Lean <giles@nemeton.com.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
descriptorsfor 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


pgsql-hackers by date:

Previous
From: Giles Lean
Date:
Subject: Re: On file locking
Next
From: Hans-Jürgen Schönig
Date:
Subject: COUNT and Performance ...