Re: Improve LWLock tranche name visibility across backends - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Improve LWLock tranche name visibility across backends
Date
Msg-id CAA5RZ0t3ZwvMNWGNFx6yobUNZNca4Rz2kLhAP8bb8chXYyXJog@mail.gmail.com
Whole thread Raw
In response to Re: Improve LWLock tranche name visibility across backends  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Improve LWLock tranche name visibility across backends
List pgsql-hackers
> > I think we could add a local backend copy that stays up to date with the
> > DSA. One idea would be to use an atomic counter to track the number of
> > entries in the DSA and compare it with a local backend counter whenever the
> > tranche name lookup occurs. If the atomic counter is higher (since we
> > don't have deletions),
> > we can update the local copy. Updating the local table should be a
> > rare occurrence, but it would
> > require an additional atomic fetch every time the name lookup occurs, in all the
> > above code paths.
> >
> > Perhaps there's a better approach?
>
> I was thinking to switch to the DSA (and update local copy) when a name is
> not found in the local copy. That way there is no need to maintain a counter and
> the DSA overhead should be rare enough.
>
> Regards,

That should work as well. good idea.

--
Sami



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events
Next
From: Dean Rasheed
Date:
Subject: Re: Typo in create_index regression test