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