Is libcurl thread-safe?
Yes. We have written the libcurl code specifically adjusted for multi-threaded programs. libcurl will use thread-safe functions instead of non-safe ones if your system has such. If you use a OpenSSL-powered libcurl in a multi-threaded environment, you need to provide one or two locking functions: http://www.openssl.org/docs/crypto/threads.html If you use a GnuTLS-powered libcurl in a multi-threaded environment, you need to provide locking function(s) for libgcrypt (which is used by GnuTLS for the crypto functions). http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html No special locking is needed with a NSS-powered libcurl. NSS is thread-safe.
265 266 As version seven is slowly marching in as the libcurl version to use, we 267 have made a serious attempt to address all places in the code where we could 268 forsee problems for multi-threaded programs. If your system has them, curl 269 will attempt to use threadsafe functions instead of non-safe ones. 270 271 I am very interested in once and for all getting some kind of report or 272 README file from those who have used libcurl in a threaded environment, 273 since I haven’t and I get this question more and more frequently! 274 graydon 1.1 275 5. license issues 276 277 Curl and libcurl are released under the MPL, the Mozilla Public License. To 278 get a really good answer to this or other licensing questions, you should 279 study the MPL license and the license you are about to use and check for 280 clashes yourself.