Re: hyperthreading and pqlib - Mailing list pgsql-general

From Tom Lane
Subject Re: hyperthreading and pqlib
Date
Msg-id 1865.1202488128@sss.pgh.pa.us
Whole thread Raw
In response to Re: hyperthreading and pqlib  (Bruce Momjian <bruce@momjian.us>)
List pgsql-general
Bruce Momjian <bruce@momjian.us> writes:
> luca.ciciriello@email.it wrote:
>> Has someone 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

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: hyperthreading and pqlib
Next
From: brian
Date:
Subject: Re: ERROR: COPY quote must be a single ASCII character