Re: listen/notify argument (old topic revisited) - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: listen/notify argument (old topic revisited)
Date
Msg-id 1025712574.23475.80.camel@taru.tm.ee
Whole thread Raw
In response to Re: listen/notify argument (old topic revisited)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: listen/notify argument (old topic revisited)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, 2002-07-03 at 16:30, Tom Lane wrote:
> Hannu Krosing <hannu@tm.ee> writes:
> > There could a little more smartness here to avoid unneccessary copying
> > (not just storing) of not-listened-to data.
> 
> Yeah, I was wondering about that too.
> 
> > I guess that depending on the circumstances this can be either faster or
> > slower than copying them all in one memmove.
> 
> The more interesting question is whether it's better to hold the read
> lock on the shared buffer for the minimum possible amount of time;

OTOH, we may decide that getting a notify ASAP is not a priority and
just go on doing what we did before if we can't get the lock and try
again the next time around.

This may have some pathological behaviours (starving some backends who
always come late ;), but we are already attracting a thundering herd by
sending a signal to all _possibly_ interested backends at the same time
time.

Keeping a list of who listens to what can solve this problem (but only
in case of sparse listening habits).

-----------------
Hannu





pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: (A) native Windows port
Next
From: Hannu Krosing
Date:
Subject: Re: listen/notify argument (old topic revisited)