Re: Notify enhancement

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Notify enhancement
Date: 2006-12-15 21:26:27
Message-ID: 20061215212627.GU14237@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-12-15 21:37:04 Re: Notify enhancement
Previous Message Andrew Dunstan 2006-12-15 20:59:20 Re: Notify enhancement