it does work on linux....but not with php as an apache module....you have to run
it as cgi.
PHP Code:
<?php
include (?threadClass.php?);
class testThread extends Thread {
function testThread($name) {
$this->Thread($name); // calls the parent constructor and assign its name
}
function run() {
while(true) {
sleep(1);
print time() .?-? . $this->getName() . ? said ok?\n?; // every second we?re going to print this line?
}
}
}
// Main program. Bring up two instances of the same class (testThread).
// They runs concurrently. It?s a multi-thread app with a few lines of code!!!
$test1 = new testThread (?Thread-1hahaha8243;);
$test2 = new testThread (?Thread-2hahaha8243;);
$test1->start();
$test2->start();
print ?This is the main process. Press [CTRL-CANC] to terminate.\n?;
while(true) {sleep(1);}
?>