Results 1 to 2 of 2
////////////////////////////////////////////////////////////////// Hi, I want to perform Parallel Processing in PHP. Let me try to explain my problem. I want to open 2 files with fopen at the same time. For ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-09-2005 #1
- Join Date
- Sep 2005
perform Parallel Processing in PHP.
I want to perform Parallel Processing in PHP. Let me try to explain my problem.
I want to open 2 files with fopen at the same time.
For Example first file takes 30 seconds and 30 seconds seond file to read in web.
and total time will be 60 seconds.
Can i read both files in 30 seconds with parallel execuation?
$handle_1 = fopen("www.domain.com/index.php", "r");
$text_1 = fread($handle_1,filesize("$handle_1"));
$handle_2 = fopen("www.domain.com/index.php", "r");
$text_2 = fread($handle_2,filesize("$handle_2"));
$text = $text_1 . $text_2;
As above code run line by line and takes much time. Is there any way that i can open both or more files Simultaneous ?
How can i execute some my code in parallel processing?
Ali Rizwan (Web Developer)
- 09-12-2005 #2
- Join Date
- Aug 2005
PHP has threading capabilities? I don't think... and seems that PHP has no non-blocking I/O method, so I don't believe this is possible...
Maybe you can use exec/system routines... search on php.net for these functions and read all posts... there are some backgrounding process control (even php scripts!). Check it out...
Two different execs download two different files..., then waits for process terminations, and then continue... maybe works... maybe can't...When using Windows, have you ever told "Ehi... do your business?"
Linux user #396597 (http://counter.li.org)