Re: libpq Win32 Mutex performance patch - Mailing list pgsql-patches

From Magnus Hagander
Subject Re: libpq Win32 Mutex performance patch
Date
Msg-id 20080421135110.1cde485c@mha-laptop
Whole thread Raw
In response to Re: libpq Win32 Mutex performance patch  (Andrew Chernow <ac@esilo.com>)
List pgsql-patches
Andrew Chernow wrote:
> Tom Lane wrote:
> >Silently not locking is surely
> > not very safe.
> >
>
> Here is the dump code version of the patch.  If anyone wants the
> return value idea, let me know.

Here's a version of this patch that doesn't use malloc - instead, I had
to change the callers to it a bit.

This makes a difference only on Vista+ really, because prior to Vista
the function InitializeCriticalSection() *can* fail - it will throw an
exception and not return any error code. Which really isn't that
different from just crashing like this latest patch from Andrew would
have us do (on out of memory).

I'm leaning towards going with the simpler one, which is the patch from
Andrew that crashes on out of memory.

Comments/preferences?

//Magnus

Attachment

pgsql-patches by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Testing pg_terminate_backend()
Next
From: Bruce Momjian
Date:
Subject: Re: Proposed patch - psql wraps at window width