cURL / Mailing Lists / curl-library / Single Mail

curl-library

Multi-threaded use of CPR / libcurl

From: Mckinney, Lee <Lee.Mckinney_at_vencore.com>
Date: Thu, 4 Aug 2016 16:16:13 +0000

We are trying to use CPR

https://github.com/whoshuu/cpr

in a multithreaded context.

We are compiling with C++11 support, and CPR was built with libcurl 7.32.

Each CPR operation (GET, POST, etc) seems to use curl_easy.
We are queuing each CPR request as:

    pool->enqueue(*threadFunction, urlStr)

where 'pool' is a ThreadPool instance of the attached third-party class.

When we use a 1-thread pool, things work.
We when use more than 1 thread, results are inconsistent. Including incomplete requests.

Are there any known gotchas to curl_easy use in a thread pool context?
Can you recommend a (better?) thread pool approach?
We are investigating CPR for the same question.

r/
Lee

--
Lee McKinney / Senior Software Engineer, CSM, SA
VENCORE, Services & Solutions Inc.
1103 Balch Blvd, Ste 210, Stennis Space Center, MS 39529
www.vencore.com


-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html

Received on 2016-08-04