[BUG][FIX] netscape browser plugin change
John M McIntosh
johnmci at smalltalkconsulting.com
Sun Aug 11 06:52:14 UTC 2002
> > So whats the story behind shortUnconditionalJump and longUnconditionalJump?
>Well short unconditional jumps are for, er, short unconditional jumps.
>1 to 8 bytes FORWARD only. Long jumps are for up to 1024 forwards and
>1024 backwards. It's the only way to jump back in a loop like the idle
>loop. If something is preventing the interruptCheckCounter from being
>decremented properly, then the ide loop will not end up calling the
>check for interrupts. Since interruptCheckCounter is supposed to be
>reset to 1000 or less in checkInterrupts, it really shouldn't be too
>long between checks. In the idleLoop there's only a dozen or so
>bytecode, so every 9 or ten (ie around about 4 million time a second on
>my 400Mhz powerbook, 1 million on my Acorn) there is a backwards branch,
>and 1 in a 1000 times there should be an interrupt check - 4,000 times a
>second.
>
>tim
Well Tim there is a check in singleExtendedSendBytecode, normalSend,
internalActivateNewMethod, plus a checkForInterrupt call is forced on
a lowres millisecond boundary change in primitiveResponse which
resets the interruptCheckCounter counter. Also the idle loop
primitive call does sleep so we aren't doing 40 million bytecodes a
second here, we are sleeping! Minimal CPU usage, 5% or say 2 million
bytecodes a second, or 200,000 times in the code in question, at this
point I believe the counter is clamped to 1000 (I looked) so the
reality is 200 times a second, versus your estimate of 4000.
But the other entry points to checkForInterrupt seem to prevent this
if statement in longUnconditionalJump from being executed.
Thus as I noticed ( in seconds) and as Tom Morgan told me it took
minutes for his browser image to terminate using just the problem
code.
--
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
More information about the Squeak-dev
mailing list
|