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

Re: Compiling libpq with VisualC

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manfred Spraul <manfred(at)colorfullife(dot)com>
Cc: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>,PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Compiling libpq with VisualC
Date: 2004-06-11 17:07:24
Message-ID: 200406111707.i5BH7O202769@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Manfred Spraul wrote:
> 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.

Agreed.  My pthread book says pthread_mutex_init() should be called only
once, and we have to guarantee that.  If the Windows implentation allows
it to be called multiple times, just create a function to be called only
by Win32 that does that and leave the Unix safe.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Scott MarloweDate: 2004-06-11 17:15:50
Subject: Re: Improving postgresql.conf
Previous:From: Bruce MomjianDate: 2004-06-11 17:02:52
Subject: Re: Improving postgresql.conf

pgsql-patches by date

Next:From: Bruce MomjianDate: 2004-06-11 17:09:49
Subject: Re: path.c char[strlen("xxx")] not portable
Previous:From: Bruce MomjianDate: 2004-06-11 17:03:18
Subject: Re: pg_ctl using START with paths needing quotes

pgsql-hackers-win32 by date

Next:From: Dann CorbitDate: 2004-06-11 17:29:02
Subject: Re: [pgsql-hackers-win32] Tablespaces
Previous:From: Bruce MomjianDate: 2004-06-11 17:03:18
Subject: Re: pg_ctl using START with paths needing quotes

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