| From: | Sami Imseih <samimseih(at)gmail(dot)com> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Proposal: Add a callback data parameter to GetNamedDSMSegment |
| Date: | 2025-12-03 18:47:46 |
| Message-ID: | CAA5RZ0uuQ9TZRQcECB6XkicOa_XuqsdnF_YmucQv85_GJOMYWA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
Can you provide more details on the use-case?
> For example, the documentation for creating LWLocks after startup [1]
> suggests creating locks in this callback. That works fine as long as
> the callback only needs to create a hardcoded lock.
The callback is called on the first invocation of GetNamedDSMSegment for
a particular segment name. Subsequent calls just attach an existing segment.
> But if the lock name is a parameter to the function calling GetNamedDSMSegment, and
> not fixed, I do not see a clean way to pass it through to the callback
Keep in mind that the tranche name shows up in wait events, so you
will end up with different wait event names.
Also,
commit 38b602b capped the number of lwlock tranches to 256, so you
may hit this limit if you are creating many lwlocks.
#define MAX_NAMED_TRANCHES 256
--
Sami Imseih
Amazon Web services (AWS)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Paul A Jungwirth | 2025-12-03 18:59:28 | Domains on ranges should create a multirange |
| Previous Message | Paul A Jungwirth | 2025-12-03 18:43:35 | Should ranges validate their subtypes' domains after canonicalization? |