Michael Chang writes:
>
> > For example, have you called mysql_thread_init() before calling
> > mysql_real_connect() in all your threads ?
>
> However, to my understanding, mysql_thread_init() is not needed if
> only one database connection is used, and that database connection
> is established when the program starts, before any threads have been
> created. That is, if you call mysql_real_connect() at the top
> of main(), for example, and you let the connection persist for the
> lifetime of the program, then mysql_thread_init() is not necessary,
> and the only thing that you must worry about is to make sure that
> critical sections (like between mysql_real_query() and
> mysql_store_result()) are sandwiched in-between a mutex lock.
>
> If the above is incorrect, please let me know.
>
>
> Michael
>
>
It is required in any case when multi-threaded program is made, which
uses our C API.
In 4.0 it is automatically invoked in my_init() if library is built
thread-safe.
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php