2006/9/8, Andrew W. Nosenko <[EMAIL PROTECTED]>:
Sorry, but documentation on the MySQL C API say nothing about many
interesting questions.

The one of them: is it safe (or unsafe) to use non-MT client library
(libmysqlclient.*, as opposite to the MT-aware libmysqlclient_r.*) for
the multithreading programs in case when every parallel mysql
connection (MYSQL*) lives in the own thread, is not shared between
threads and doesn't migrates between threads.  Just born in the own
thread, lives in the same own thread and dies in the own thread?  Of
course, queries (select/insert/delete/..., both using "plain old"
mysql_real_query() and prepared prepared statements, using
transactions and not) may be executed in the one and the same time in
the different threads.

Second question: the same as first but for case when connections may
migrate between threads -- born in the one thread, used in the second,
dies in third... but anyway at the one time the one connection is used
by the only one thread.  At the next time it may be another but,
again, only one thread.

Well the only precaution you need for MT program regarding mysql
client lib, is to do a mysql_thread_init() and mysql_thread_end(); and
yes you should do it for every thread.
do you have a special requirement to use libmysql instead of
libmysql_r ? I would guess there is some global variables or system
calls that might fails with the non-MT version.

--
http://www.myspace.com/sakuradrop : credit runs faster
http://www.w-fenec.org/  Rock Webzine

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to