Re: Lock on arbitrary string feature

From: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
To: Adam Haberlach <adam(at)newsnipple(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Lock on arbitrary string feature
Date: 2001-01-12 03:08:40
Message-ID: 3.0.5.32.20010112110840.00847100@192.228.128.13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

At 09:38 AM 11-01-2001 -0800, Adam Haberlach wrote:
> We do something like this with listen/notify pairs. To syncronize
>two clients, we have them each listen for the other's token string,
>send a notify, and then block on select(), checking for incoming
>notifications. When they get the notification, they send a notify back
>to the other side to un-block it.
>
> If anything, it would be nice if there were a way to make a LISTEN
>block the connection on a specific event tag, which is essentially what
>we are doing in our interface library.

Actually what you are talking about is almost an inverse of this locking
thing. One is stop until it's ok to go. The other is stop if it's not ok to
go.

You're looking for a WAIT for "notification" feature :).

I actually was looking for this too, and I thought I was the only one
interested in this. Wow a 100% increase in interest ;).

I'm also trying to see how this can be done. It looks a lot easier to do
than the getlock feature. But I can't figure out what to select/wait/snooze
on, when the routine is in the inside looking about (async.c:
Async_Wait(char *relname) yeah oxymoronic I know). Rather than outside
looking in (in which case it's select PQsocket or something like that).
Would like to use as little CPU as possible when waiting - think of
postgresql on battery powered wearable "servers" + wireless LAN.

Cheerio,
Link.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2001-01-12 03:15:10 Re: AW: Re: GiST for 7.1 !!
Previous Message Tom Lane 2001-01-12 03:08:12 Re: AW: Re: GiST for 7.1 !!

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-01-12 04:48:40 Re: patch for BETWEEN [ASYMMETRIC|SYMMETRIC]
Previous Message Lincoln Yeoh 2001-01-12 02:37:39 Re: Lock on arbitrary string feature