Re: Compiling libpq with VisualC

From: Manfred Spraul <manfred(at)colorfullife(dot)com>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Compiling libpq with VisualC
Date: 2004-06-11 15:50:09
Message-ID: 40C9D4B1.30200@colorfullife.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

Andreas Pflug wrote:

> I don't really think so. That mutex_initialized is a globally static
> variable, not a thread local one. Thread interruption between testing
> mutex_initialized and setting it is very unlikely and still wouldn't
> do much harm if it actually does happen.
>
Very unlikely is not a good argument. And you haven't considered
multiprocessor systems. They aren't that rare: all newer Pentium 4
systems have two logical cores.
The harm would be a failed connection attempt - I don't think that this
is acceptable.

Hmm. Is libpq a .DLL? Then you could initialize the mutex in DllMain().
Otherwise create a C++ class with one instance and a constructor. Then
initialize the mutex from the constructor.

--
Manfred

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message pgsql 2004-06-11 15:51:04 msession for PostgreSQL?
Previous Message Greg Stark 2004-06-11 15:33:19 Re: Tablespaces

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message pgsql 2004-06-11 16:28:29 Re: Tablespaces
Previous Message Simon Riggs 2004-06-11 11:59:56 Fix for erroneous warning on Shutdown

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-06-11 16:37:31 Fix for Win32 START
Previous Message Simon Riggs 2004-06-11 11:59:56 Fix for erroneous warning on Shutdown