| 
 Posted by Colin McKinnon on 09/30/05 12:08 
Chris Hope wrote: 
 
> Schroeder, AJ wrote: 
>  
>> I have googled this topic and I know this has been asked before, but 
>> there seems to be no good answer except "PHP doesn't support 
>> multi-threading" I am new to PHP so I might be using the wrong 
>> terminology. 
>  
> That is correct. PHP has no support for multi threading. 
>   
<snip> 
>  
> You can fork a process using the PHP CLI (assuming you're on a *nix box 
> and it soundsl ike you probably are) like you can with most other 
> scripting languages. 
>  
 
Or you (if you're not interested in the process after it starts) can ask the 
OS to start up a new process, even if it's only web accessible: 
 
for ($x=0; $x<count($devices); $x++) { 
        $url="http://localhost/snmp_grab.php?dev=" . $device[$x]; 
        $cmd="curl '$url'"; // or {"php -q /docroot/snmp_grab " . $device[$x]}  
                                // or lynx, or w3m, or ... 
        `echo "$cmd" | at now`; 
} 
 
HTH 
 
C.
 
[Back to original message] 
 |