Re: multi-threaded pgbench - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: multi-threaded pgbench
Date
Msg-id 20090723120538.9820.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: multi-threaded pgbench  (Greg Smith <gsmith@gregsmith.com>)
Responses Re: multi-threaded pgbench
List pgsql-hackers
Greg Smith <gsmith@gregsmith.com> wrote:

> That second code path, when --enable-thread-safety is turned off, crashes
> and burns on my Linux system:

It comes from confliction of identifiers.
Renaming identifiers with #define can solve the errors:

#define pthread_t                pg_pthread_t
#define pthread_attr_t            pg_pthread_attr_t
#define pthread_create            pg_pthread_create
#define pthread_join            pg_pthread_join
typedef struct fork_pthread       *pthread_t;
...

Another idea is that we don't use pthread and add 'pg_thread' wrapper
module on the top of pthread.

We can choose either of implementations... Which is better?


> $ ./pgbench -j 16 -S -c 24 -t 10000 pgbench
> number of clients (24) must be a multiple number of threads (16)

It's hard on forking-thread platforms because multiple threads need
to access the job queue. We need to put the queue on inter-process
shared memory, but it introduces additional complexities.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: [PATCH] DefaultACLs
Next
From: Petr Jelinek
Date:
Subject: Re: [PATCH] DefaultACLs