Re: On file locking

Поиск
Список
Период
Сортировка
От Curt Sampson
Тема Re: On file locking
Дата
Msg-id Pine.NEB.4.51.0302011509320.610@angelic.cynic.net
обсуждение исходный текст
Ответ на Re: On file locking  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: On file locking
Список pgsql-hackers
On Fri, 31 Jan 2003, Tom Lane wrote:

> 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.

Yes. I note that in NetBSD, that paragraph of the manual page is
identical except that the last sentence has been removed.

At any rate, it seems to me highly unlikely that, since the child has
the *same* descriptor as the parent had, that the lock would disappear.

The other option would be that the lock belongs to the process, in which
case one would think that a child doing an unlock should not affect the
parent, because it's a different process....

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Curt Sampson
Дата:
Сообщение: Re: Linux.conf.au 2003 Report
Следующее
От: Curt Sampson
Дата:
Сообщение: Re: PostgreSQL, NetBSD and NFS