[BUG] User interrupts no longer interrupt locked UI process

Ned Konz ned at squeakland.org
Fri Mar 19 05:40:50 UTC 2004


On Thursday 18 March 2004 8:26 pm, Tim Rowledge wrote:
> Good grief - 116 million? Since it starts at 1000 that's an awful lot
> of hits on checkForInterrupts and the feedback testing. You have
> pretty fast machine so I can see it managing quite a few sends of a 0
> arg message per second. Any time through checkForInterrupts less than
> interruptChecksEveryNms milliseconds after the last time you get
> another 10 on your reset value, so I imagine this will build quite
> quickly at first. Then you'll get to a GC which will probably trigger
> the timer related call to cFI as well. Back to recursing some more,
> adding 10 every now and then, and more GCs. It's really hard to see how
> you can reach 116M - after all interruptChecksEveryNms is 3 in the
> current VMs and if you reach any kind of steady state you should be
> decrementing interruptCheckCounter for each real send, hitting cFI when
> that reaches 0, testing to see if the last bunch took less than 3mS and
> if :-

What I was seeing is that during recursion it got to a point where (since it 
had built up a large count) it was never calling checkForInterrupts again.

Instead, quickCheckForInterrupts was decrementing the number by 1 each time.

Which of course never got it to 0 before all the memory was eaten.

If you look at what happens around tight recursion with no other calls, you 
will see that only quickCheckForInterrupts is called. And that wasn't 
working.

So zeroing the counter after a fullGC gives us a chance to have 
checkForInterrupts called from quickCheckForInterrupts.

In this case it works quite well, and shouldn't have any other bad effects.

Remember, this is a machine that can do a fair number of message sends and 
bytecodes per second:

0 tinyBenchmarks 
 '214765100 bytecodes/sec; 7119708 sends/sec'
'214765100 bytecodes/sec; 7021070 sends/sec'
 '214945424 bytecodes/sec; 6694354 sends/sec'

So in that 3 msec we can do about 645000 bytecodes, and 21000 message sends. 
Which is a lot of recursive methods (at first, at least) without much getting 
in the way. Then we hit the GCs.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list