cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Link between curl_easy handle and connection

From: Pierre Brico <pierre.brico_at_gmail.com>
Date: Tue, 8 Mar 2016 09:40:59 +0100

On Mon, Mar 7, 2016 at 9:24 PM, Isaac Boukris <iboukris_at_gmail.com> wrote:

> On Mon, Mar 7, 2016 at 8:01 PM, Pierre Brico <pierre.brico_at_gmail.com>
> wrote:
> >
> > Okay, I see what you mean. You use the curl_multi API to wrap an easy
> handle
> > to avoid sharing connections between easy handles as written in curl
> > documentation:
> ...
> > If I follow your suggestion, I will have one multi handle per transfer
> and
> > so one thread to manage it (waste of resources). This will prevent me to
> > execute thousands transfers in parallel (currently one thread is able to
> > process 100 connections).
>
>
> Not quite. The suggested approach is non-blocking and asynchronous and
> could therefore be used in event-loop applications.
>
> There is no need of a separate thread for each multi and you can run
> them in parallel within a single thread.
> All you need is, to keep the multi handle available (e.g. by attaching
> it to the user's private opaque).
>
> OK, I see what you mean. I will give a try to your approach and keep you
in touch.

> BTW, please avoid top-posting, it makes it hard to follow (see
> etiquette link below).
>

Sorry about top-posting. I didn't read all the recommendations. From now
on, I will pay attention.

Thanks again.

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-08