Re: On file locking - Mailing list pgsql-hackers

From Tom Lane
Subject Re: On file locking
Date
Msg-id 8834.1044027292@sss.pgh.pa.us
Whole thread Raw
In response to Re: On file locking  (Antti Haapala <antti.haapala@iki.fi>)
Responses Re: On file locking  (Curt Sampson <cjs@cynic.net>)
List pgsql-hackers
Antti Haapala <antti.haapala@iki.fi> writes:
> And from SunOS 5.8 flock
>      Locks are on files, not file  descriptors.   That  is,  file
>      descriptors  duplicated  through  dup(2)  or  fork(2) do not
>      result in multiple instances of a lock, but rather  multiple
>      references to a single lock.  If a process holding a lock on
>      a file forks and the child explicitly unlocks the file,  the
>      parent  will  lose  its  lock.  Locks are not inherited by a
>      child process.

That seems self-contradictory.  If the fork results in multiple
references to the open file, then I should think that if the parent
dies but the child still holds the file open, then the lock still
exists.  Seems that some experimentation is called for ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: PostgreSQL, NetBSD and NFS
Next
From: Oleg Bartunov
Date:
Subject: Re: [OpenFTS-general] relor and relkov