cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Threads and curl_easy_pause

From: óÏÌÏ×ØÅ× áÎÄÒÅÊ <andy-84_at_yandex.ru>
Date: Tue, 02 Oct 2012 10:29:06 +0400

Hi.

"this function is not meant to be called from any other thread than the same thread you use libcurl in"

You mean I should call curl_easy_pause() only from the same thread, which will execute perform() and write callback?

Another question - is it possible to use a single curl instance in several threads (of course, not at the same time)? For example, can I create curl instance in thread A and then give it to thread B, which sets options, calls perform() etc. ?

Regards, andy

29.09.2012, 18:00, "Daniel Stenberg" <daniel_at_haxx.se>:

> šOn Mon, 24 Sep 2012, óÏÌÏ×ØÅ× áÎÄÒÅÊ wrote:
>> ššDocumentation for curl_easy_pause() states: "NOTE: while it may feel
>> šštempting, take care and notice that you cannot call this function from
>> ššanother thread."
>>
>> ššWhat thread is permitted to call this function?
> šI don't know about "permitted", but I prefer to state clearly that this
> šfunction is not meant to be called from any other thread than the same thread
> šyou use libcurl in. libcurl has no thread awareness or locking of any kind.
>
> šYou may figure out ways on how you still can do this from multiple threads and
> šI wish you all the best with that, but I still won't recommend that approach.
>
> šIf you have a suggestion on how to phrase that better in the documentation
> šthan what it currently does, please tell us!
>
> š--
>
> ššš/ daniel.haxx.se
>
> š,
> š-------------------------------------------------------------------
> šList admin: http://cool.haxx.se/list/listinfo/curl-library
> šEtiquette: šhttp://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-02