Re: introduce dynamic shared memory registry

Поиск
Список
Период
Сортировка
От Zhang Mingli
Тема Re: introduce dynamic shared memory registry
Дата
Msg-id 99177ac8-f3cb-40eb-a8c1-b1aede77b803@Spark
обсуждение исходный текст
Ответ на introduce dynamic shared memory registry  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: introduce dynamic shared memory registry  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
Hi, all

I see most xxxShmemInit functions have the logic to handle IsUnderPostmaster env.
Do we need to consider it in DSMRegistryShmemInit() too? For example, add some assertions.
Others LGTM.


Zhang Mingli
www.hashdata.xyz
On Dec 5, 2023 at 11:47 +0800, Nathan Bossart <nathandbossart@gmail.com>, 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.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Remove MSVC scripts from the tree
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: introduce dynamic shared memory registry