tick callbacks,not concurrently?

From: Date: Sat, 02 Sep 2000 20:19:40 +0000
Subject: tick callbacks,not concurrently?
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-31681@lists.php.net to get a copy of this message
I wasn´t unable to watch the forking process completely. Execute this script, it shows that a) sequential executing with for() equals tick executing, time-wise, I assume that this is not ok, well maybe I ran into the WTF thing and did not understand what´s going on, I thought these functions were executed concurrently, what is (apparently) not the case. Ok. they must be spawned sequentially, but even replacing usleep with sleep(1) keeps these proportions in time difference. b) referenced variable $b is only increased in every function in for(), that´s ok. $b=3; function foo(&$a) { $a++; usleep(10000000); $x=substr(microtime(),0,10)."\n"; print "(1[$a])$x\n"; } function zoo(&$b) { $b++; $x=substr(microtime(),0,10)."\n"; print "(2[$b])$x\n"; } function boo(&$b) { $b++; $x=substr(microtime(),0,10)."\n"; print "(3[$b])$x\n"; } register_tick_function("foo",$b); register_tick_function("zoo",$b); register_tick_function("boo",$b); declare (ticks = 3)
{    1;1;1;1;1;1;1;1;1; }
?><BR><?php
for ($i=1;$i<=3;$i++)    {
foo($b); zoo($b); boo($b); }

« previous php.dev (#31681) next »