Delay and Linux

Gary Chambers gazzaguru2 at btinternet.com
Tue Jun 12 18:14:59 UTC 2007


Even with a loadavg (via uptime) was still around 44ms (for a 10ms delay)
for me.
Found the culprit though...

In sqUnixMain.c


sqInt ioRelinquishProcessorForMicroseconds(sqInt us)
{
  int now;
  dpy->ioRelinquishProcessorForMicroseconds(us);
  now= ioLowResMSecs();
  if (now - lastInterruptCheck > (1000/25))	/* avoid thrashing intr
checks from 1ms loop in idle proc  */
    {
      setInterruptCheckCounter(-1000);	/* ensure timely poll for semaphore
activity */
      lastInterruptCheck= now;
    }
  return 0;
}

Note the (1000/25) which equals 40ms, around the same as the latency.
Called from #relinquishProcessorForMicroseconds: in ProcessorScheduler,
By the the idle process with a 1000 microsecond value.
This reliquishes the processor for the 1000 microseconds then doesn't check
for interrupts (including
Pending delay semaphores) until at least 40ms have passed.

Perhaps this could be made into a VM parameter?


-----Original Message-----
From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of subbukk
Sent: 11 June 2007 5:39 pm
To: squeak-dev at lists.squeakfoundation.org
Subject: Re: Delay and Linux


On Monday 11 June 2007 7:24 pm, Gary Chambers wrote:
> Hi all. Does anybody know why, on the Linux VM (3.9.8), short Delays
> (<500ms) wait for significantly longer than under Windows (3.10.4)?
Delay for x ms means schedule squeak to run *after* x ms. If another process

is hogging the cpu, then it would take as much as one time slice before 
squeak gets to the cpu. So check your loadavg. On my lightly loaded Linux 
box, I got 100.12 and 100.22ms.

Regards .. Subbu




More information about the Squeak-dev mailing list