Re: introduce dynamic shared memory registry - Mailing list pgsql-hackers

From Joe Conway
Subject Re: introduce dynamic shared memory registry
Date
Msg-id 12a9d0a3-5ea2-40cc-a1e5-4acb7d1e0178@joeconway.com
Whole thread Raw
In response to introduce dynamic shared memory registry  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: introduce dynamic shared memory registry
List pgsql-hackers
On 12/4/23 22:46, Nathan Bossart wrote:
> Every once in a while, I find myself wanting to use shared memory in a
> loadable module without requiring it to be loaded at server start via
> shared_preload_libraries.  The DSM API offers a nice way to create and
> manage dynamic shared memory segments, so creating a segment after server
> start is easy enough.  However, AFAICT there's no easy way to teach other
> backends about the segment without storing the handles in shared memory,
> which puts us right back at square one.
> 
> The attached 0001 introduces a "DSM registry" to solve this problem.  The
> API provides an easy way to allocate/initialize a segment or to attach to
> an existing one.  The registry itself is just a dshash table that stores
> the handles keyed by a module-specified string.  0002 adds a test for the
> registry that demonstrates basic usage.
> 
> I don't presently have any concrete plans to use this for anything, but I
> thought it might be useful for extensions for caching, etc. and wanted to
> see whether there was any interest in the feature.

Notwithstanding any dragons there may be, and not having actually looked 
at the the patches, I love the concept! +<many>

-- 
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com




pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Postgres Partitions Limitations (5.11.2.3)
Next
From: Stephen Frost
Date:
Subject: Re: Detecting some cases of missing backup_label