What is difference between libmysqlclient.a and libmysqlclient_r.a?

心已入冬 提交于 2019-12-08 17:45:27

问题


Which should I use to link for mysqlclient library? What is the difference between them? I can't seem to find the answer. Thanks.


回答1:


libmysqlclient_r.a is thread-safe




回答2:


Newer versions of the MySQL client distributions do not include the "_r" version. Some may have a symbolic link from libmyqslclient_r.a to libmyqslclient.a




回答3:


libmysqlclient_r.a is "re-entrant". https://en.wikipedia.org/wiki/Reentrant_%28subroutine%29 But as Garret pointed out, there is no difference in newer versions (both are re-entrant).




回答4:


libmysqlclient_r is guaranteed to be thread-safe per connection. However, MySQL documentations prior to MySQL 5.5 are vague on whether multi-threaded applications can link to libmysqlclient as long as there are no simultaneous access on a single MySQL connection handle.

Base on experience though, I used libmysqlclient for applications that processes 100-400 queries per second and have been running for 5 years. I've yet to encounter any issues.



来源:https://stackoverflow.com/questions/4486584/what-is-difference-between-libmysqlclient-a-and-libmysqlclient-r-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!