[squeak-dev] Re: Another interesting behavior of Delay
Igor Stasenko
siguctua at gmail.com
Tue Sep 22 05:11:50 UTC 2009
Another illustration that there is something wrong with scheduling the
same delay multiple times:
| d sema t1 t2 t3 |
d := Delay forMilliseconds: 200.
sema := Semaphore new.
first := nil.
[ d wait. t1:= Time millisecondClockValue. sema signal ] forkAt:
Processor activePriority +1.
[ (Delay forMilliseconds: 100) wait.
d wait. t2 := Time millisecondClockValue. sema signal ] forkAt:
Processor activePriority -1.
[ (Delay forMilliseconds: 150) wait.
d wait. t3 := Time millisecondClockValue. sema signal ] forkAt:
Processor activePriority -1.
sema wait.
sema wait.
sema wait.
{ t1. t2. t3 } - Time millisecondClockValue
prints #(0 0 0)
while obviously, different processes should have different time of
returning from wait.
I'm also increased the delays by 10x factor (i.e. 2000, 1000, 1500),
and still having #(0 0 0) as result.
--
Best regards,
Igor Stasenko AKA sig.
More information about the Squeak-dev
mailing list
|