Skip site navigation (1) Skip section navigation (2)

Re: multi-threaded pgbench

From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: multi-threaded pgbench
Date: 2009-07-23 03:25:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Greg Smith <gsmith(at)gregsmith(dot)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.

ITAGAKI Takahiro
NTT Open Source Software Center

In response to


pgsql-hackers by date

Next:From: Petr JelinekDate: 2009-07-23 03:26:05
Subject: Re: [PATCH] DefaultACLs
Previous:From: Joshua TolleyDate: 2009-07-23 03:21:27
Subject: Re: [PATCH] DefaultACLs

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group