Skip to main content

PHP-CURL curl_multi_exec is it really multithreaded internally?



My question is very simple as stated in title. However I rephrase it again.





I want to download multiple sites using php-curl. I'll run it from console. I am going to use curl_multi_exec to download all the sites. Now the question, will curl create different threads for each of the request?





I know I can achieve it by forking multiple processes. But thats not threading. I dont want threading. I want to know if its multi-threaded?


Comments

  1. The answer is yes. But a common problem is name resolving. By the default the Linux gethostbyname() is a synchronous function and having X threads instead of one won't help, because they are executed in serial, because they are blocking behind resolving DNS. On Windows DNS resolving is asynchrous by default, however.

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?