Understanding PHP multi_curl_exec loops

In the PHP curl_multi_exec manual, a strange 3 loops are given as an example: do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } I was wondering why we needed so many while loops as opposed to a simple one such as: do { curl_multi_exec($master,$running); } while($running > 0); What I have found is mostly due to prevent making unnecessary calls to curl_multi_exec.
Read more...