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

libpq Win32 Mutex performance patch

From: Andrew Chernow <ac(at)esilo(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: libpq Win32 Mutex performance patch
Date: 2008-04-11 18:41:40
Message-ID: 47FFB0E4.8040105@esilo.com (view raw or flat)
Thread:
Lists: pgsql-patches
I noticed several months ago, and came across it again today, that 
libpq's pthread-win32.c implementation is using CreateMutex rather than 
CRITICAL_SECTION.  CreateMutex is like a semaphore in that it is 
designed to be accessible via name system-wide.  Even when you don't 
give it a name, thus bound to process that created it, it still carries 
significant overhead compared to using win32 CRITICAL_SECTIONs.

The attached patch replaces the win32 mutex calls with critical section 
calls.  The change will not affect the behavior of the windows 
pthread_xxx functions.

-- 
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

Attachment: win32_mutex.patch
Description: text/plain (2.0 KB)

Responses

pgsql-patches by date

Next:From: Magnus HaganderDate: 2008-04-11 18:49:34
Subject: Re: libpq Win32 Mutex performance patch
Previous:From: Merlin MoncureDate: 2008-04-11 17:57:46
Subject: Re: libpq patch for pqtypes hook api and PGresult creation

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