Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Is mysql_real_connect thread safe?

From: Dhammika Pathirana <dhammika(at)asperasoft.com>
Date: Wed Jun 27 2007 - 13:27:18 EDT


Hi,

I'm working on a multi-threaded daemon written in C/C++ for FreeBSD. This daemon uses libmysqlclient_r.so.15 to query a mysql db. Both libmysqlclient_r and the daemon are compiled with -lpthread and all threads are initialized with mysql_init. If I startup this daemon process at system bootup (through rc.d) then I get the following core, but it seems to work fine if I start it manually (after system bootup). Would really appreciate any help on this.

#0 0x2846926f in pthread_testcancel () from /usr/lib/libpthread.so.1
(gdb) bt
#0 0x2846926f in pthread_testcancel () from /usr/lib/libpthread.so.1
#1 0x28461856 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
#2 0x00000000 in ?? ()

(gdb) info threads
* 5 LWP 100248 0x2846926f in pthread_testcancel () from /usr/lib/libpthread.so.1
 4 Thread 4 (runnable) 0x287a269b in my_stat () from /usr/local/aspera/lib/libmysqlclient_r.so.15   3 Thread 3 (LWP 100252) 0x2846924f in pthread_testcancel () from /usr/lib/libpthread.so.1
 2 Thread 2 (sleeping) 0x2846115b in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
 1 Thread 1 (runnable) 0x285ac907 in read () from /lib/libc.so.5

thanks in advance

Dhammika

-- 
MySQL Internals Mailing List
For list archives: 
http://lists.mysql.com/internals
To unsubscribe:    
http://lists.mysql.com/internals?unsub=lists@pantek.com
Received on Wed Jun 27 13:27:35 2007

This archive was generated by hypermail 2.1.8 : Wed Jun 27 2007 - 13:30:02 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library