cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Is CURL struct thread-safe?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 8 Dec 2009 23:07:04 +0100 (CET)

On Tue, 8 Dec 2009, Jonathan Wallace wrote:

> I may occasionally have 4-10 threads all using the same CURL instance. Can
> I do this, or will it screw something up?

If you by "the same CURL instance" mean the same handle returned by
curl_easy_init() then yes it will seriously screw things up:

   http://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Multi-threading

You can still share stuff between multiple handles by using the share
interface:

   http://curl.haxx.se/libcurl/c/libcurl-share.html

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-08