please?

From: Pablo Funes <pablo(at)cs(dot)brandeis(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: please?
Date: 1999-05-31 17:08:32
Message-ID: 199905311708.NAA32523@mancha.cs.brandeis.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Please take a sec to read this question. I've posted
it several times but got no comments at all. Thanx, Pablo.

---

Forwarded message:
>From pablo Thu May 27 18:42:11 1999
Subject: nonblocking lock?
To: pgsql-hackers(at)postgresql(dot)org
Date: Thu, 27 May 1999 18:42:11 -0400 (EDT)
Content-Type: text
Content-Length: 890

Is it possible to do a nonblocking lock? That is,
I want several clients to execute,

begin
if table A is locked
then
go around doing stuff on other tables
else
lock A and do stuff on A that takes a long time
endif

the problem is, if I use normal lock, then
after one client has locked and is doing stuff on A
the other one will block and thus it won't be able
to go around doing stuff on other tables. Is it
possible to do a nonblocking lock that will just
fail if the table is locked already?

NOTE: I tried using PQrequestCancel but it won't
cancel the request. It still blocks for as long
as the lock lasts. The only way around I've found so
far is to use PQreset. That's crude but works. But
it leaves a dangling postmaster process that lives
until the orignal lock is freed. Any other ideas?

Thanks a lot

Pablo Funes
Brandeis University
pablo(at)cs(dot)brandeis(dot)edu

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-05-31 17:13:50 Re: [HACKERS] Open 6.5 items
Previous Message Bruce Momjian 1999-05-31 16:20:37 Re: [HACKERS] New IP address datatype