[unixODBC-dev] thread strategies

Marek Kustka mkustka at sophics.cz
Wed Jun 29 16:16:58 BST 2005


Nick Gorham wrote:
> Marek Kustka wrote:
> 
>> Hi,
>>
>> we have a web-based application which uses Firebird SQL server. Our 
>> multithreaded back end
>> server accesses it through UnixODBC and Easysoft's IB/FB driver. We 
>> seem to have a problem
>> when multiple simultaneous requests come up: Processing speed drops 
>> down dramatically.
>> I have setup some profiling points and found out that any arbitrary 
>> ODBC call (such as
>> SQLNumResulCols, SQLDescribeCol, SQLBindCol, SQLExecute) can take 
>> 100-1000x longer
>> time to process. Sorrounding ODBC calls from a given thread are 
>> typically regularly fast.
>> Probability of slow ones raises with increasing load from our app.
>>
>> My feeling is that it could be caused by some kind of synchronization, 
>> because we are not able
>> to load cpu(s) enough. I have scanned UnixODBC sources and noticed 
>> comments about various
>> thread strategies in __handles.c file.
>>
>> I want to ask if EasySoft's IB/FB driver handles some of these 
>> synchronizations, so I could
>> SAFELY lower the default level of 3 and test the effect. I can only 
>> test it on our production database.
>> We do use our own connection pool that handles a list of open 
>> connections - this code is synchronized.
>> Thanks to ODBC library we use, every our connection has different 
>> environment handle.
>> So we basically create, employ and drop statement objects in our 
>> functions. We do not synchronize
>> statement level ODBC calls at all.
>>
> Hi,
> 
> As long as the version of the firebird interface lib you are using is 
> thread safe, and you are using the current version of our driver  (there 
> is a specific firebird version now) the you can leave the threading to 
> the driver and remove the protection in the driver manager.
> 
> In older version of the interbase driver we had to protect the GDB lib 
> as the Borland 6.5 version wasn't thread safe.
> 

Hi Nick,

i have a trial version of easysoft firebird odbc driver 1.0.0
and i can see some "invalid free() 0xaddress" messages in our log
and as i do not know where they come from so far, I am a bit scared
to use it for a production. It seems to work otherwise.

If you call "firebird interface lib" our (adopted) ODBC library
(you saw it :/) then yes, it should be thread safe in terms of
not sharing any critical resources between connections and statements.

In case of older Easysoft IB/FB driver (ver.2.1.1), does it mean that
i cannot use N<3 for threading mode against firebird 1.52?

Thank you,
Marek



More information about the unixODBC-dev mailing list