Hello folks,
I'm looking for some information about MySQL thread-safeness, but I'm not understanding well the manual (http://dev.mysql.com/doc/mysql/en/Threaded_clients.html). It says "If you don't need interrupts or timeouts, you can just compile a thread-safe client library (mysqlclient_r) and use this", but later it says mysql_real_connect() is not thread safe.
Could someone, please, help me understanding this?
1. How exactly is the thread-safeness level of mysqlclient_r library?
2. Can I share a connection between threads or not?
3. Just using mysqlclient_r instead of mysqlclient is enough to get thread safeness?
Marcelo:
The "thread-safety" of mysqlclient_r as opposed to the regular one is simply in blocking disruptive signals during network I/O operations. If you want to share the same connection between thread, you will need a mutex around some calls (see the docs you mentioned above). If you are using mysql_use_result(), you will need to have a mutex from the call to mysql_query() to mysql_free_result() for sure. If you do mysql_store_result(), you can release it after mysql_store_result() returns.
-- Sasha Pachev Create online surveys at http://www.surveyz.com/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]