Go to the first, previous, next, last section, table of contents.


Making a threadsafe client

All functions except mysql_connect() are currently thread safe.

To get connect thread_safe you have to do the following:

Recompile the client with:

CPPFLAGS=-DTHREAD_SAFE_CLIENT ./configure ...

You may get some errors because of undefined symbols when linking the standard client as the pthread libraries are not included by default.

The resulting libmysqld.a library is now thread safe.

Two threads can't use the same handle (returned by mysql_connect()) at the same time, even if two threads can use different MYSQL_RES handles that were created with mysql_store_result().

When using a threaded client one can have great use of the thr_alarm.c routine. If you are using the mysys routines, the only thing one has to remember is to call my_init() first!


Go to the first, previous, next, last section, table of contents.