On Wed, 2002-07-03 at 16:30, Tom Lane wrote: > Hannu Krosing <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster