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

Re: Compiling libpq with VisualC

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Compiling libpq with VisualC
Date: 2004-06-11 17:51:41
Message-ID: 40C9F12D.5080705@pse-consulting.de (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Bruce Momjian wrote:

>
>
>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.
>
>  
>
Ok, so here's the win32 workaround with the unix stuff left untouched.
There's no memory interlocking api in win32 that wouldn't need some 
initializing api call itself, so we'd have to go for assembly level 
test-and-set code or introduce a mandatory global libpq initializing 
api. Considering the probably quite low usage of kerberos/ssl together 
with threads under win32, and the very low probability of two 
threads/processors (!) trying to initiate a connection at the same time, 
it doesn't seem to be worth the compiler hassle with assembly inline.

Regards,
Andreas



Attachment: pthread.h.win32
Description: text/plain (410 bytes)
Attachment: pthread-win32.c
Description: text/plain (803 bytes)
Attachment: win32-threadsafety.patch
Description: text/plain (3.9 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2004-06-11 17:58:15
Subject: Re: msession for PostgreSQL?
Previous:From: Tom LaneDate: 2004-06-11 17:49:18
Subject: Re: Accelerating aggregates

pgsql-patches by date

Next:From: Tom LaneDate: 2004-06-11 17:53:22
Subject: Re: pg_ctl using START with paths needing quotes
Previous:From: Euler Taveira de OliveiraDate: 2004-06-11 17:44:14
Subject: Re: translation updates pt_BR

pgsql-hackers-win32 by date

Next:From: Tom LaneDate: 2004-06-11 17:53:22
Subject: Re: pg_ctl using START with paths needing quotes
Previous:From: Dann CorbitDate: 2004-06-11 17:29:02
Subject: Re: [pgsql-hackers-win32] Tablespaces

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