Re: [multithreading] extension compatibility

Поиск
Список
Период
Сортировка
От Jelte Fennema-Nio
Тема Re: [multithreading] extension compatibility
Дата
Msg-id CAGECzQQni+MBig-27FwJoPQAhLpg=b=JpTHNX0VnLN-uCWmh=g@mail.gmail.com
обсуждение исходный текст
Ответ на [multithreading] extension compatibility  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, 5 Jun 2024 at 22:05, Robert Haas <robertmhaas@gmail.com> wrote:
> The attached patch is a sketch of one possible approach: PostgreSQL
> signals whether it is multithreaded by defining or not defining
> PG_MULTITHREADING in pg_config_manual.h, and an extension signals
> thread-readiness by defining PG_THREADSAFE_EXTENSION before including
> any PostgreSQL headers other than postgres.h.

My first gut-reaction: It seems kinda annoying to have to do this for
every c that you use to build your extension, e.g. citus or postgis
have a ton of those.

PG_MODULE_MAGIC seems like a better fit imho.

If we really want a compile time failure, then I think I'd prefer to
have a new postgres.h file (e.g. postgres-thread.h) that you would
include instead of plain postgres.h. Basically this file could then
contain the below two lines:

#include "postgres.h"
#define PG_THREADSAFE_EXTENSION    1



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

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: problems with "Shared Memory and Semaphores" section of docs
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs