cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Thread safety

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 15 Jun 2012 12:38:15 +0200 (CEST)

On Thu, 14 Jun 2012, Konstantin Miller wrote:

> Do you mean that although an explicit call to curl_global_init is not thread
> safe, an implicit call from, e.g., curl_easy_init is still thread safe? So
> that in a multi-threaded process I would not want to explicitely call
> curl_global_init but rather would call curl_easy_init and rely on the
> implicit initialization?

No.

I mean you should call curl_global_init() in the beginning of your
application's life time - as documented, knowing that it isn't thread-safe.
Then you call curl_easy_init() in your threads as that function is
thread-safe!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-06-15