View Single Post
Old 10-19-2005, 06:11 AM  
ServerGenius
Confirmed User
 
Join Date: Feb 2002
Location: Amsterdam
Posts: 9,377
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 processPress [CTRL-CANCto terminate.\n?;
    while(
true) {sleep(1);}

    
?>
__________________
| http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |
ServerGenius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote