Re: Support to define custom wait events for extensions

From: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tristan Partin <tristan(at)neon(dot)tech>, andres(at)anarazel(dot)de, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Support to define custom wait events for extensions
Date: 2023-07-27 09:29:22
Message-ID: cd09c86daa9e4c1c5f7903da39b75994@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, all.

Sorry for late reply.

> I am still mid-way through the review of the core APIs, but attached
> is my current version in progress, labelled v8. I'll continue
> tomorrow. I'm aware of some typos in the commit message of this
> patch, and the dynamic bgworker launch is failing in the CI for
> VS2019 (just too tired to finish debugging that today).

I suspect that I forgot to specify "volatile" to the variable
for the spinlock.

+/* dynamic allocation counter for custom wait events for extensions */
+typedef struct WaitEventExtensionCounter
+{
+ int nextId; /* next ID to assign */
+ slock_t mutex; /* protects the counter only */
+} WaitEventExtensionCounter;
+
+/* pointer to the shared memory */
+static WaitEventExtensionCounter * waitEventExtensionCounter;

Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinoda, Noriyoshi (HPE Services Japan - FSIP) 2023-07-27 09:36:35 RE: remaining sql/json patches
Previous Message Michael Paquier 2023-07-27 09:16:46 Re: Support to define custom wait events for extensions