Re: pgbench: option delaying queries till connections establishment?
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Marina Polyakova <m.polyakova@postgrespro.ru>,
pgsql-hackers <pgsql-hackers@postgresql.org>, kuroda.hayato@fujitsu.com
Date: 2021-01-30T12:17:57Z
Lists: pgsql-hackers
Attachments
- v9.0001.pgbench-barrier.patch (text/x-diff) patch v9
- v9.0002.pgbench-barrier.patch (text/x-diff) patch v9
- v9.0003.pgbench-barrier.patch (text/x-diff) patch v9
Hello Thomas, >> 3 . Decide if it's sane for the Windows-based emulation to be in here >> too, or if it should stay in pgbench.c. Or alternatively, if we're >> emulating pthread stuff on Windows, why not also put the other pthread >> emulation stuff from pgbench.c into a "ports" file; that seems >> premature and overkill for your project. I dunno. > > I decided to solve only the macOS problem for now. So in this > version, the A and B patches are exactly as you had them in your v7, > except that B includes “port/pg_pthread.h” instead of <pthread.h>. > > Maybe it’d make sense to move the Win32 pthread emulation stuff out of > pgbench.c into src/port too (the pre-existing stuff, and the new > barrier stuff you added), but that seems like a separate patch, one > that I’m not best placed to write, and it’s not clear to me that we’ll > want to be using pthread APIs as our main abstraction if/when thread > usage increases in the PG source tree anyway. Other opinions welcome. I think it would be much more consistent to move all the thread complement stuff there directly: Currently (v8) the windows implementation is in pgbench and the MacOS implementation in port, which is quite messy. Attached is a patch set which does that. I cannot test it neither on Windows nor on MacOS. Path 1 & 2 are really independent. -- Fabien.
Commits
-
Fix new pthread code to respect --disable-thread-safety.
- de91c3b976cf 14.0 landed
-
Add missing pthread_barrier_t.
- 44bf3d5083e1 14.0 landed
-
pgbench: Improve time logic.
- 547f04e7348b 14.0 landed
-
pgbench: Refactor thread portability support.
- b1d6a8f86813 14.0 landed
-
pgbench: Synchronize client threads.
- aeb57af8e640 14.0 landed
-
Fix bogus logic for skipping unnecessary partcollation dependencies.
- 84d514887f9c 12.0 cited