cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Removing internal dual interface code handling

From: Gokhan Sengun <gokhansengun_at_gmail.com>
Date: Tue, 27 Nov 2012 15:30:35 +0200

Hi Yehezkel,

I looked at your patch and saw that curl_easy_perform now do:
> + mcode = curl_multi_wait(multi, NULL, 0, 1000, NULL);
> + if(mcode == CURLM_OK)
> + mcode = curl_multi_perform(multi, &still_running);
>
> My comments:
> 1. The first call should be to curl_multi_perform and only then to
> curl_multi_wait (why wasting the time before we tried to progress).
> 2. I would expect socket-event based code (as replacement of the
> select/poll call), currently you just wait for 1 second before making
> progress even if the socket is ready before.
> This could decrease the performance of libcurl, which is one of the
> killing features it has.
>
>
Please note that curl_multi_wait is not a blocking call in every case. It
will block only until a network activity is detected (in recv case) or
network activity is possible (in send case). Please see
http://curl.haxx.se/libcurl/c/curl_multi_wait.html.

curl_multi_wait internally uses a poll/select call on the active sockets
and indirectly monitors the sockets in the handle.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-27