On 22/02/2024 01:03, Thomas Munro wrote:
> On Thu, Feb 22, 2024 at 10:30 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>> collisions arbitrarily far apart (just decide how many bits to use).
>
> . o O ( Perhaps if you also allocated slots using a FIFO freelist,
> instead of the current linear search for the first free slot, you
> could maximise the time before a slot is reused, improving the
> collision-avoiding power of a generation scheme? )
We could also enlarge dsm_handle from 32-bits to 64-bits, if we're
worried about collisions.
I actually experimented with something like that too: I encoded the "is
this in main region" in one of the high bits and let the implementation
use the low bits. One small issue with that is that we have a few places
that pass a DSM handle as the 'bgw_main' argument when launching a
worker process, and on 32-bit platforms that would not be wide enough.
Those could be changed to use the wider 'bgw_extra' field instead, though.
--
Heikki Linnakangas
Neon (https://neon.tech)