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: (view raw, whole thread or download thread mbox)
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

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


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-2018 The PostgreSQL Global Development Group