[unixODBC-support] thread safety

Tomáš Macek macek at fortech.cz
Wed Aug 20 13:50:42 BST 2008


Hello, I'd like to know, if unixODBC is thread safe. I found something 
in ChangeLog redarding thread safety, but no finish statement saying 
"yes, thread safe".

I'm programming an application, that needs to have threads over 
libpthreads in Linux. Can I use the ODBC connection in threads passed 
as parameter? Something like

SQLHDBC conn = NULL;
SQLHENV env = NULL;

int main(...) {
   ...
   SQLConnect(conn, (SQLCHAR *)dsn, SQL_NTS, NULL, 0, NULL, 0);
   ...
   pthread_create(&thread_id, NULL, &conn, NULL);
   ...
}

Can I pass the connection parameter into each newly created thread?

Thanks, Tomas



More information about the unixODBC-support mailing list