pgsql: pgbench: Refactor thread portability support.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pgbench: Refactor thread portability support.
Date: 2021-03-10 04:52:01
Message-ID: E1lJqpF-00064d-Bk@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pgbench: Refactor thread portability support.

Instead of maintaining an incomplete emulation of POSIX threads for
Windows, let's use an extremely minimalist macro-based abstraction for
now. A later patch will extend this, without the need to supply more
complicated pthread emulation code. (There may be a need for a more
serious portable thread abstraction in later projects, but this is not
it.)

Minor incidental problems fixed: it wasn't OK to use (pthread_t) 0 as a
special value, it wasn't OK to compare thread_t values with ==, and we
incorrectly assumed that pthread functions set errno.

Discussion: https://postgr.es/m/20200227180100.zyvjwzcpiokfsqm2%40alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b1d6a8f86813772b9198367a34c8ff8bff7fef9e

Modified Files
--------------
src/bin/pgbench/pgbench.c | 126 ++++++++++++----------------------------------
1 file changed, 31 insertions(+), 95 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-03-10 05:55:05 pgsql: Move tablespace path re-creation from the makefiles to pg_regres
Previous Message Amit Kapila 2021-03-10 04:43:14 pgsql: Fix valgrind issue in commit 05c8482f7f.