Re: Support to define custom wait events for extensions

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Support to define custom wait events for extensions
Дата
Msg-id CALj2ACW=Lourradi-Kb=hGFfdNxdejx3kOeUdToaUky+L3xKZw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support to define custom wait events for extensions  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Support to define custom wait events for extensions  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Mon, Jul 31, 2023 at 12:58 PM Michael Paquier <michael@paquier.xyz> wrote:
>
>
> Attaching a v11 based on Bharath's feedback and yours, for now.  I
> have also applied the addition of the two masking variables in
> wait_event.c separately with 7395a90.

+uint32 WaitEventExtensionNew(void)
+</programlisting>
+     Next, each process needs to associate the wait event allocated previously
+     to a user-facing custom string, which is something done by calling:
+<programlisting>
+void WaitEventExtensionRegisterName(uint32 wait_event_info, const
char *wait_event_name)
+</programlisting>
+     An example can be found in
<filename>src/test/modules/worker_spi</filename>
+     in the PostgreSQL source tree.
+    </para>

Do you think it's worth adding a note here in the docs about an
external module defining more than one custom wait event? A pseudo
code if possible or just a note? Also, how about a XXX comment atop
WaitEventExtensionNew and/or WaitEventExtensionRegisterName on the
possibility of extending the functions to support allocation of more
than one custom wait events?

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



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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: Avoid undefined behavior with msvc compiler (src/include/port/pg_bitutils.h)
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Support to define custom wait events for extensions