cURL / Mailing Lists / curl-library / Single Mail

curl-library

Common designs for using libcurl (Thread-Safety)

From: Jonathon <thejunkjon_at_gmail.com>
Date: Wed, 7 Sep 2011 10:25:34 -0700

Hi,

I am planning to use libcurl in my web client. My web client will be
primarily responsible for posting data to web servers over SSL (and
sometimes through a proxy). Sometimes, there will be quite a load on
my web client (posting a lot of data) and therefore, I might need some
additional threads to improve throughput.

In order to combat the issues described here:
http://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Multi-threading

I've decided just to create a thread pool and have each thread
responsible for maintaining one connection; however, this seems
overkill to me for small loads.

Is there a common, accepted approach for using libcurl efficiently,
maximizing throughput, and also not running into any of the threading
issues described above in the link?

I've come across the reactor and proactor design patterns, but I am
not sure if they will be "libcurl-friendly" :)

J
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-07