cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: thread pooling

From: Dima Q <dimaqq_at_gmail.com>
Date: Thu, 18 Feb 2010 18:24:37 +0200

Why do you need to use multiple processors?
What takes your CPU time, is it SSL, your code in callbacks or what?
In my experience, curl rarely uses that much CPU on advanced systems
(like smp).

Btw you could, conceivably create a regular (not multi) handle for every
task that you do and run each from a separate thread. That was your OS
should schedule your threads as it sees fit and curl should not be able
to interfere.

d.

On 02/13/10 14:57, vick wrote:
> if you make one multi-handle for each processor, you are still not
> having a way to use a pool of free threads/processors because you
> could be busy as hell on one proc, but the other one empty. basically
> i am thinking some kind of balancing and the multi handle has to work
> across processors.
>
> From: Daniel Stenberg<daniel_at_haxx.se>
> To: libcurl development<curl-library_at_cool.haxx.se>
> Subject: Re: thread pooling
> Message-ID:<alpine.DEB.2.00.1002122008080.12881_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Fri, 12 Feb 2010, vick wrote:
>
>
>>> suppose i want to do async i/o with pooled threads. i create as many threads
>>> as there are processors. Basically would like curl multi to take advantage
>>> of multiple processors and complete operations on each of them. but as curl
>>> is not thread aware, wondering how that is possible.
>>>
>
>> Make one multi handle for each CPU and run the multi_socket API on each and
>> you'll get maximum performance. I think.
>>
> -------------------------------------------------------------------
> 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 2010-02-18