cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl and multithreading

From: Dominik Raddatz <dominik.raddatz_at_neomo.de>
Date: Thu, 22 Dec 2005 14:36:13 +0100

hi.
i just encountered a little multithreading problem with libcurl, c-bindings,
version 7.13.2-2sarge for
Linux 2.6.8-2-686-smp #1 SMP Thu May 19 17:27:55 JST 2005 i686 GNU/Linux

using only curl_easy_init, without calling curl_global_init first, is not
thread safe.
when curl_easy_init is called twice concurrently, it seems that both functions
call curl_global_init, which makes the program crash or getting into a
deadlock or behave strange in some other way.

the easy workaround is to call curl_global_init explicitly, but that should be
mentioned in the manual near the documentation of either functions, i.e.
stating that not calling curl_global_init causes some multithreading
problems.

thanks,
        dominik
Received on 2005-12-22