Re: Notify enhancement - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Notify enhancement
Date
Msg-id 20061215212627.GU14237@alvh.no-ip.org
Whole thread Raw
In response to Re: Notify enhancement  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Notify enhancement
List pgsql-hackers
Andrew Dunstan wrote:


> I don't understand how we decide that everybody who needs a given 
> event+message has got it, if we don't know who (if anyone) is listening? 
> How do we decide that we no longer need the info in the shmem buffer? 

Keep a pointer in shared memory for each listener backend, saying how
far it has scanned the ring?  There would be a single writing pointer,
so it's trivial to see when the ring is "full".

> Timeout? sinval issues a reset if the buffer becomes full, but we can't 
> do that here.

Just have NOTIFY block when the buffer is full, and maybe issue a
warning so that the user knows that he should increase the ring size.


> Are we keeping use of SIGUSR2 in this scheme?

What for?  Just protect the write pointer with a lwlock and have
listeners check whether somebody has written something.


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Notify enhancement
Next
From: Tom Lane
Date:
Subject: Re: Notify enhancement