cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_global_init

From: Jason Pump <jpump_at_mindspring.com>
Date: Wed, 29 Mar 2006 12:49:39 -0800

The single call your entire program has to curl_global_init should be
done at the initialization of your program and there should be no other
threads running at that time. After the call has been made at startup
you do not ever have to make another call to curl_global_init and so you
don't have anything else you would have to synchronize.

Raquel Vieira wrote:

> Hi!
>
> I saw in the libcurl documentation, in the description of the
> curl_global_init function, something like:
>
> "This function is not thread safe. You must not call it when any other
> thread in the program (i.e. a thread sharing the same memory) is
> running. This doesn't just mean no other thread that is using libcurl.
> Because curl_global_init() calls functions of other libraries that are
> similarly thread unsafe, it could conflict with any other thread that
> uses these other libraries."
>
> Does anyone know what does this mean? It means that I have to use a
> mutex in the access of libcurl if I have more than one thread that use
> libcurl or I can't have more than one thread executing at the same
> time, even if they aren't using libculr?
>
> Raquel Vieira
>
>
>
Received on 2006-03-29