cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: new multi interface functions, continued

From: Justin Hammond <justin_at_dynam.ac>
Date: Thu, 10 Mar 2005 15:00:39 +0000 (UTC)

Daniel Stenberg <daniel-curl_at_haxx.se> wrote:
>On Wed, 9 Mar 2005, Justin Hammond wrote:
>
<snip>
>> You might be thinking, but the curl_multi_* functions are called on every
>> loop of the mainloop, well, if you look at at lot of the event libraries,
>> they wrap up the entire mainloop, and its difficult to get our own functions
>> included into the mainloop. In the case of libevent, the only way would be
>> to create a Timer in libevent that curls curl_multi_update every 0(!)
>> seconds
>
>> This avoids the cases in those applications where Curl is not the main *HOG*
>> on network communications. It will allow us to only call
>> curl_multi_update/curl_multi_socket when we know there is going to be some
>> curl activity rather than every loop of the mainloop
>
>I'm afraid I don't quite follow you here, very possibly because I know nothing
>about libevent or how you use it.
>
>Can you elaborate a bit, perhaps with a little snippet of pseudo code on how
>it would work?
>

Ok, suggest you have a quick read over the libevent man page for a idea how it
operates (http://www.monkey.org/~provos/libevent/event3.html), but it basically
replaces the mainloop of a program with its own call, in this case,
event_dispatch(). (there are ways around it though.... but not for this
discussion).

Looking at the rest of the thread, seems that this is kinda redundant now as
the page you put up does a good job of what we are thinking here.
Received on 2005-03-10