Re: On file locking

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Antti Haapala <antti(dot)haapala(at)iki(dot)fi>
Cc: Kevin Brown <kevin(at)sysexperts(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On file locking
Date: 2003-01-31 15:34:52
Message-ID: 8834.1044027292@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Antti Haapala <antti(dot)haapala(at)iki(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2003-01-31 16:10:13 Re: PostgreSQL, NetBSD and NFS
Previous Message Robert Treat 2003-01-31 14:57:25 Re: [PATCHES] v7.2.4 bundled ...