Re: Ragged latency log data in multi-threaded pgbench - Mailing list pgsql-hackers

From Takahiro Itagaki
Subject Re: Ragged latency log data in multi-threaded pgbench
Date
Msg-id 20100316094647.9C19.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Ragged latency log data in multi-threaded pgbench  (Greg Smith <greg@2ndquadrant.com>)
Responses Re: Ragged latency log data in multi-threaded pgbench
Re: Ragged latency log data in multi-threaded pgbench
List pgsql-hackers
Greg Smith <greg@2ndquadrant.com> wrote:

> It looks like the switch between clients running on separate workers can 
> lead to a mix of their respective lines showing up though.

Oops. There might be two solutions for the issue: 1. Use explicit locks. The lock primitive will be pthread_mutex for
multi-threaded implementations or semaphore for multi-threaded ones. 2. Use per-thread log files.    File names would
be"pgbench_log.<main-process-id>.<thread-id>".
 

Which is better, or another idea?

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




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Getting to beta1
Next
From: Tom Lane
Date:
Subject: Re: Should we throw error when converting a nonexistent/ambiguous timestamp?