Comments and more improvement.

more logic to not do extra processing. A lot more comments to explain whats happening.
"When libcurl returns -1 in max_fd, it is because libcurl currently does something that isn't possible for your application to monitor with a socket and unfortunately you can then not know exactly when the current action is completed using select(). When max_fd returns with -1, you need to wait a while and then proceed and call curl_multi_perform anyway. How long to wait? I would suggest 100 milliseconds at least, but you may want to test it out in your own particular conditions to find a suitable value." - from curl_multi_fdset documentation (http://curl.haxx.se/libcurl/c/curl_multi_fdset.html)...

Basically if nothing has started after calling curl_multi_perform for the very first time, none of the file descriptors are set and hence our application has no means to communicate to the kernel's event handler. Doing a sleep gives curl_multi_perform time to get started and curl_multi_fdset to return a maxFD not equal to -1.

In my tests so far, its very random and it takes 100-300 mseconds for a file descriptor to be picked up.