Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-03 Thread Zsolt Parragi
> I ran into this when I was > working on GetNamedDSA() and GetNamedDSHash() Thanks for mentioning these, I didn't notice them when I rebased on the master branch. One of my use cases was this, I implemented something similar to GetNamedDSHash - it's a generic wrapper for dshash in C++, and I ran

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-03 Thread Nathan Bossart
On Wed, Dec 03, 2025 at 02:59:16PM -0600, Sami Imseih wrote: > Yes, that's true. It will be hard to find other good use-cases that > can't be solved with a global variable, but we can also say this is > a low-cost change, so why not just do it. Well, for one, it requires all existing extensions th

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-03 Thread Sami Imseih
> On Wed, Dec 03, 2025 at 02:27:29PM -0600, Sami Imseih wrote: > > There are probably other good reasons to allow a generic argument > > to the init callback. Besides the lwlock name, I can see someone > > wanting to pass some other initialization info that may vary > > depending on extension GUCs,

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-03 Thread Nathan Bossart
On Wed, Dec 03, 2025 at 02:27:29PM -0600, Sami Imseih wrote: > There are probably other good reasons to allow a generic argument > to the init callback. Besides the lwlock name, I can see someone > wanting to pass some other initialization info that may vary > depending on extension GUCs, etc. The

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-03 Thread Sami Imseih
> My gut feeling is that this is an obscure enough use-case that this > workaround is probably sufficient, but I am interested to hear more... There are probably other good reasons to allow a generic argument to the init callback. Besides the lwlock name, I can see someone wanting to pass some oth

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-03 Thread Nathan Bossart
On Wed, Dec 03, 2025 at 12:47:46PM -0600, Sami Imseih wrote: > Can you provide more details on the use-case? I think the main use-case is creating multiple DSM segments in the registry that use the same initialization callback. I ran into this when I was working on GetNamedDSA() and GetNamedDSHas

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-03 Thread Sami Imseih
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