Re: hyperthreading and pqlib

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: luca(dot)ciciriello(at)email(dot)it, pgsql-general(at)postgresql(dot)org
Subject: Re: hyperthreading and pqlib
Date: 2008-02-08 16:28:48
Message-ID: 1865.1202488128@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> luca(dot)ciciriello(at)email(dot)it wrote:
>> Has someone&nbsp;encountered a problem using pqlib in a multi-threading
>> application (POSIX or Win32) when the Intel Hyperthreading is enabled?
>> Disabling the hyperthreading option from the bios of the computer all works
>> fine, otherwise the threaded application does freeze randomically after a
>> while (This behaviour is common to Linux and WIndows version of the
>> multi-threaded application).Any idea?Thanks in advance.Luca.

> What version of Postgres? Does the application freeze or the operating
> system? We have not heard similar reports. We don't actually recommend
> hyperthreading usually.

What it sounds like to me is that the multithreaded application has bugs
(race conditions) that happen to be more easily exposed when HT is on,
presumably because it's then possible for more threads to actually execute
concurrently.

If libpq is involved in this at all, it's probably because you're
failing to prevent multiple threads from using the same PGconn object at
the same time. But it's just as likely that the bug is completely
unrelated to libpq.

Anyway, you're going to need to get out your debugger and see where it's
getting stuck before you can make much progress fixing it.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message brian 2008-02-08 16:53:26 Re: ERROR: COPY quote must be a single ASCII character
Previous Message Bruce Momjian 2008-02-08 16:14:00 Re: hyperthreading and pqlib