List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:September 18 2006 11:47am
Subject:Re: Does MySQL++ Lib needs to be recompiled with -pthread for Multithreading?
View as plain text  
Ankur G35 Saxena wrote:
> do you think i need to recompile the code of mysql++ to be
> -pthread safe 

Absolutely.

> so that my full application becomes pthread safe?

If you believe that a simple linkage change will make your program 
thread-safe you are quite mistaken.  Get a book on threads, and read of 
the many many ways your program can die, even when all the code is 
thread-aware.  Ensuring stability in a multithreaded program is highly 
nontrivial.

And no, before you ask, MySQL++ is not in any sense thread-safe.  All 
building it with thread support does is makes it use thread-aware 
versions of your system's standard libraries, so that calls down into 
those libraries don't crash.  See all the mutex/Lock stuff on the 
Wishlist for a start.  (In particular, read the part of the MySQL 
documentation linked to from the Wishlist, which explains the 
constraints we must meet.)  Until we get that out of the way, blind use 
of the library in a multithreaded app is almost guaranteed to cause 
problems.  And after that, I'm still not prepared to offer a guarantee 
that ignorance will go unpunished.
Thread
Does MySQL++ Lib needs to be recompiled with -pthread for Multithreading?Ankur G35 Saxena16 Sep
  • Re: Does MySQL++ Lib needs to be recompiled with -pthread for Multithreading?Warren Young18 Sep