add("one"); $TQ->add("two"); $TQ->add("three"); $TQ->add("four"); $TQ->add("five"); // wait until all threads exit while( count( $TQ->threads() ) ){ // there are existing processes in the background? sleep(1); // optional echo "waiting for all jobs done...\n"; $TQ->tick(); // mandatory! } echo "all process finished.\n";