Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql lib for unix has problems when run in multi thread way

Status
Not open for further replies.

ankursaxena

Programmer
Sep 7, 2001
133
US
Hi!
I have a program which creats multiple threads of a function, each of the funtion create a connection, run the query and close connection and continues doing that in an infinite loop. i dont understand why this procedure gives a segmentation fault core dump, sometimes bus error core dump. when i run the same program and only create 1 thread, no problem, but as soon as i create 3,4,5 thread, it starts cribbing at random times. generally the error is in run_query function creating some new memory as it uses my_malloc function.

this lead to conclusion that the lib provided my mysql install is not thread safe,is this correct, or am i doing something wrong, i doubt i am, cuz i have checked it with process, single threads, but no problem with that, only in multi thread senario, the problem occurs, someone please help.

thanx a ton.
Ankur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top