Re: Revised Patch to allow multiple table locks in "Unison"

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: Neil Padgett <npadgett(at)redhat(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, "pgsql-patches(at)postgresql(dot)org" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Revised Patch to allow multiple table locks in "Unison"
Date: 2001-07-30 16:16:22
Message-ID: 3B658856.C47EADAD@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hiroshi Inoue wrote:
>
> Is it paranoid to worry about the followings ?
>
> 1) Concurrent 'lock table a, b;' and 'lock table b, a;'
> could last forever in theory ?

You would need a very evil timeslice duration on a single processor, but
it
could happen on a dual processor. However, the two processes would have
to
be synchronized in a very narrow window of instructions, the schedulers
in
both machines would have to be precisely synchronized and absolutely no
interruption (that is not common to both machines) could never occur.
Even a keyboard press will break the enchantment.

I guess it is what we call "unstable equilibrium", possible in theory
but
never happens in practice except for an infinitesimal amount of time.
It is trying to make an egg stand on one end or something like that
(without breaking the egg, of course :-) ).

> 2) 'Lock table a,b' could hardly acquire the lock when
> both the table a and b are very frequently accessed.
>

Yes, multiple locks with the back off is less aggressive than obtaining
and holding the locks (with individual lock commands).

--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-07-30 16:20:58 Re: Revised Patch to allow multiple table locks in "Unison"
Previous Message BigWhat.com 2001-07-30 15:52:59

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-07-30 16:16:25 Re: Add ANALYZE to tab complete in psql
Previous Message Randy Hall 2001-07-30 16:06:00 Add ANALYZE to tab complete in psql