[unixODBC-dev] Multithreading

Martin Evans martin.evans at easysoft.com
Thu Dec 6 16:24:16 GMT 2007


ethiele at donewell.de wrote:
> Hello everbody,
> 
> unixODBC 2.2.12 does not scale when compiled threadsafe, without it 
> scales fine.
> i hope it is not intendet to make threadsafe = run only in one Thread a 
> time.

According to the specification an ODBC driver should be thread-safe.
However, some UNIX ODBC drivers are not. If a driver is thread-safe and 
the the unixODBC driver manager is not told to apply any threading 
restrictions then there are no threading restrictions other than any the 
ODBC driver applies.

As a workaround for those drivers which are NOT thread-safe unixODBC can 
be made to restrict them to one thread at a time using an env, dbc, stmt 
etc. See __handles.c in the source code - the granularity can be finer 
than just one at a time in the process. If a driver is NOT thread-safe 
there is no point in running it with multiple threads unless unixODBC 
restricts to one thread - if you didn't it would potentially fail 
catastrophically.

What makes you think unixODBC does not scale when built with 
--enable-threads=yes?

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com



More information about the unixODBC-dev mailing list