pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jason Koeninger <jkoenin@jjcc.com>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Thread Safety of ODBC Driver
Date: Sun, 08 Sep 2002 21:37:41 -0500
Message-ID: <20020909024343.90819474E53@postgresql.org> (raw)
In-Reply-To: <3D7C009F.385D115@tpf.co.jp>

On Mon, 09 Sep 2002 10:59:59 +0900, Hiroshi Inoue wrote:

>I've developped psqlodbc mainly from Windows side. 
>I've planned a trial thread-safe implementation
>under Windows.

Ahh...thanks for the information.  I was coming completely from 
the Unix side and wasn't thinking at all about Windows....as you 
noticed.

>As for unix I knew about a few xxx_r functions but
>I don't know details about it and unfortunately
>there's no developper from unix side.

Looks like it will probably be me then...  ;->

>Jason Koeninger wrote:
>> 
>> execute.c:  Uses the conns global in PGAPI_Transact.
>
>My plan under Windows is to use CriticalSection to serialize
>the access to conns global.

That's probably the most straightforward approach on Windows, but 
I don't believe there's an equivalent on Unix.  We'll probably have to 
use System V semaphores or Pthread mutexes.  

>gpps.c is used with neither iDOBC nor unixODBC.
>I have no interest for standalone driver.

Thanks for the heads up.  I was in a hurry and just read every .c and 
.h file not paying attention to whether or not they were actually used.
Needless to say, I found it odd that the driver would have its own 
ini file functions.

>> misc.c:  Also has some getpwuid and getuid calls.  mylog and
>> qlog probably need to be serialized, but they shouldn't cause a
>> crash.
>
>I would also use another CriticalSection to serialize the
>access to mylog or qlog.

Critical sections are reliable ways to move from single to multi-threaded 
support for functions that have to be serialized, but given the number of 
times both functions are called in the code, it might be worthwhile to 
consider other options (log thread or semaphores).  For client applications, 
I don't see it being a huge issue.

>*nixes, the *make* may be broken. I'm happy if you
>can figure out how to manage it together with 
>the thread-safe option.

I'll look more closely at the compile issues as I have time and see what 
I can figure out.  I read the GBorg page the other day, but I'll go back 
and take a look at the procedures for submitting patches.  

Best Regards,

Jason Koeninger
J&J Computer Consulting
http://www.jjcc.com





view thread (6+ messages)  latest in thread

Message-ID: <20020909024343.90819474E53@postgresql.org>
Permalink:  ../20020909024343.90819474E53@postgresql.org/
Also on:    postgresql.org/message-id/20020909024343.90819474E53@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: jkoenin@jjcc.com, Inoue@tpf.co.jp
  Subject: Re: Thread Safety of ODBC Driver
  In-Reply-To: <20020909024343.90819474E53@postgresql.org>
  References: <3D7C009F.385D115@tpf.co.jp> <20020909024343.90819474E53@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox