[squeak-dev] Re: Delay time question

Igor Stasenko siguctua at gmail.com
Thu Feb 28 05:59:46 UTC 2008


2008/2/28 Andreas Raab <andreas.raab at gmx.de>:
> Robert F. Scheer wrote:
>  > Is this behavior well-known and understood or is there something wrong
>  > with my install?
>
>  This is a very well known issue. Different operating systems have very
>  different minimal timer resolutions. Generally speaking, on Windows and
>  Mac OS the timer resolution is very close to 1ms whereas most Linux
>  kernels have *awful* timer resolutions. I have been told that you can
>  recompile your kernel to fix it but I'm not sure how. The classic
>  benchmark to verify your timer accuracy is to do something like here:
>
>         delay := Delay forMilliseconds: 1.
>         bag := Bag new.
>         1000 timesRepeat:[bag add: [delay wait] timeToRun].
>         bag sortedCounts
>
>  On my box it yields "a SortedCollection(941->1 51->2 8->3)" which means
>  that 94.1% of the delays are true 1msec delays.
>
Here the numbers for HydraVM.
 a SortedCollection(895->2 91->1 14->3)

It can't be so precise as old VM, because delay timeouts are signaled
in separate thread as event, which is then
consumed by Interpreter as soon as possible, but it takes a little
more time (switching threads e.t.c).
Things can be more precise on multicore system.

I had a hard time fighting with delays lately.. what i can say.. this
is one of the weakest and critical points in VM and language side.

>  Cheers,
>    - Andreas
>

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list