Re: [multithreading] extension compatibility

2024-06-13 Thread Robert Haas
On Thu, Jun 6, 2024 at 10:32 AM Heikki Linnakangas wrote: > > Well, OK, so it sounds like I'm outvoted, at least at the moment. > > Maybe that will change as more people vote, but for now, that's where > > we are. Given that, I suppose we want something more like Tristan's > > patch, but with a mo

Re: [multithreading] extension compatibility

2024-06-06 Thread Heikki Linnakangas
On 06/06/2024 17:23, Robert Haas wrote: On Thu, Jun 6, 2024 at 5:00 AM Heikki Linnakangas wrote: If there is some material harm from compiling with multithreading support even if you're not using it, we should try to fix that. I'm not dead set against having a compile-time option, but I don't s

Re: [multithreading] extension compatibility

2024-06-06 Thread Robert Haas
On Thu, Jun 6, 2024 at 5:00 AM Heikki Linnakangas wrote: > If there is some material harm from compiling with multithreading > support even if you're not using it, we should try to fix that. I'm not > dead set against having a compile-time option, but I don't see the need > for it at the moment.

Re: [multithreading] extension compatibility

2024-06-06 Thread Heikki Linnakangas
On 06/06/2024 05:47, Robert Haas wrote: On Wed, Jun 5, 2024 at 10:09 PM Andres Freund wrote: Maybe. I think shipping a mode where users can fairly simply toggle between threaded and process mode will allow us to get this stable a *lot* quicker than if we distribute two builds. Most users don't

Re: [multithreading] extension compatibility

2024-06-05 Thread Robert Haas
On Wed, Jun 5, 2024 at 10:09 PM Andres Freund wrote: > Maybe. I think shipping a mode where users can fairly simply toggle between > threaded and process mode will allow us to get this stable a *lot* quicker > than if we distribute two builds. Most users don't build from source, distros > will hav

Re: [multithreading] extension compatibility

2024-06-05 Thread Andres Freund
Hi, On 2024-06-05 21:59:42 -0400, Robert Haas wrote: > On Wed, Jun 5, 2024 at 9:50 PM Andres Freund wrote: > > Depending on the architecture / ABI / compiler options it's often not > > meaningfully more expensive to access a thread local variable than a > > "normal" > > variable. > > > > I think

Re: [multithreading] extension compatibility

2024-06-05 Thread Robert Haas
On Wed, Jun 5, 2024 at 9:50 PM Andres Freund wrote: > Depending on the architecture / ABI / compiler options it's often not > meaningfully more expensive to access a thread local variable than a "normal" > variable. > > I think these days it's e.g. more expensive on x86-64 windows, but not > linux

Re: [multithreading] extension compatibility

2024-06-05 Thread Andres Freund
Hi, On 2024-06-05 21:10:01 -0400, Robert Haas wrote: > On Wed, Jun 5, 2024 at 8:01 PM Heikki Linnakangas wrote: > > I'm very much in favor of a runtime toggle. To be precise, a > > PGC_POSTMASTER setting. We'll get a lot more testing if you can easily > > turn it on/off, and so far I haven't seen

Re: [multithreading] extension compatibility

2024-06-05 Thread Robert Haas
On Wed, Jun 5, 2024 at 8:01 PM Heikki Linnakangas wrote: > I'm very much in favor of a runtime toggle. To be precise, a > PGC_POSTMASTER setting. We'll get a lot more testing if you can easily > turn it on/off, and so far I haven't seen anything that would require it > to be a compile time option.

Re: [multithreading] extension compatibility

2024-06-05 Thread Heikki Linnakangas
On 05/06/2024 23:55, Robert Haas wrote: On Wed, Jun 5, 2024 at 4:32 PM Tristan Partin wrote: Not entirely sure how I feel about the approach you've taken, but here is a patch that Heikki and I put together for extension compatibility. It's not a build time solution, but a runtime solution. Inst

Re: [multithreading] extension compatibility

2024-06-05 Thread Tristan Partin
On Wed Jun 5, 2024 at 3:56 PM CDT, Robert Haas wrote: On Wed, Jun 5, 2024 at 4:32 PM Tristan Partin wrote: > Not entirely sure how I feel about the approach you've taken, but here > is a patch that Heikki and I put together for extension compatibility. > It's not a build time solution, but a run

Re: [multithreading] extension compatibility

2024-06-05 Thread Robert Haas
On Wed, Jun 5, 2024 at 4:32 PM Tristan Partin wrote: > Not entirely sure how I feel about the approach you've taken, but here > is a patch that Heikki and I put together for extension compatibility. > It's not a build time solution, but a runtime solution. Instead of > PG_MODULE_MAGIC, extensions

Re: [multithreading] extension compatibility

2024-06-05 Thread Jelte Fennema-Nio
On Wed, 5 Jun 2024 at 22:05, Robert Haas 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_E

Re: [multithreading] extension compatibility

2024-06-05 Thread Tristan Partin
On Wed Jun 5, 2024 at 3:05 PM CDT, Robert Haas wrote: ... == Extension Compatibility Solutions == 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

[multithreading] extension compatibility

2024-06-05 Thread Robert Haas
Hi, At 2024.pgconf.dev, Heikki did a session on multithreading PostgreSQL which I was unfortunately unable to attend due my involvement with another session, and then we had an unconference discussion which I was able to attend and at which I volunteered to have a look at a couple of tasks, includ