Subject: Threading and ares

Threading and ares

From: Michael Mastroianni <>
Date: 2005-10-21

Let me try to explain better. I have 300 threads running, all using
curl_easy to download content.

I put the printfs around calls to ares_gethostbyname, because it seemed
like it was synchronizing on me-


With 300 threads downloading, I would expect to see a lot of
interleaving, ie

Host started [timestamp]

Host www.foobar <http://www.foobar/> .com ended [timestamp]

Host <> started [timestamp]

Host ended [timestamp]


Instead, I'm seeing only

Host started [timestamp]

Host ended [timestamp]

Host started [timestamp]

Host ended [timestamp]

Host started [timestamp]

Host ended [timestamp]


With 300 threads downloading at once, this seems implausible; Jason Pump
suggested that the call was non-blocking,

but the times can be 15 seconds. Does this mean that I have something
seriously mis-configured?


Thanks for any help,

Michael Mastroianni



On Fri, 21 Oct 2005, Michael Mastroianni wrote:


> I should probably be posting to the ares list, but I haven't seen any

> mail from it, and can't view the archives, so I'll try here.


There is a c-ares mail archive, but the link was arong on the subscribe
page (I just fixed it):


> The weird thing is that they seem to be synchronized, ie, if the first

> one is, so is the next one, _always_. I would

> expect to see some interleaving in stderr, ie,

> starts and ends.


Sorry, but I don't understand what you tested here and what the problem
is with what you got.


And I do think this belongs on the c-ares list...


  Commercial curl and libcurl Technical Support:
Received on Fri Oct 21 20:55:38 2005