MySQL Forums
Forum List  »  Connector/C (libmysql)

C API and threads
Posted by: Chris Slominski
Date: June 02, 2005 06:47AM

I am using the MySQL RPM provided with Linux redhat 4, which is MySQL 4.1.10a. I build with the mysqlclient_r thread safe library and have verified it was a thread safe build using "int mysql_thread_safe()". I am writing a pthread application and I have chosen to have each thread create its own connection. In past threaded applications I used one connection and just serialized the use of the connection between threads with a mutex. My new design has contention problems. The server will tell me "Query was empty" after threads perform a write. I have read the online C API reference, but am uncertain as to the order in which the various init and connect routines need to be called, and in which thread context they must be called. Thank you for any assistance.


Options: ReplyQuote

Written By
C API and threads
June 02, 2005 06:47AM
June 06, 2005 08:50AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.