cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl from multiple threads and callback functions

From: Michal Marek <mmarek_at_suse.cz>
Date: Wed, 02 Jan 2008 10:01:26 +0100

Andreas Volz napsal(a):
> I read that curl is thread save, So does curl only call the callback
> once the same time if I use curl from multiple threads? Or do I need to
> protect the callback with a mutex?

Depends on what your callback actually does. If you manipulate global
data, you need to protect them. If you only touch the per-callback data
set via CURLOPT_WRITEDATA, then you're safe.

hth,
Michal
Received on 2008-01-02