I'm just done with refactoring, as was planned in http://lists.squeakfoundation.org/pipermail/vm-dev/2008-February/001795.html. I was surprised that VM runs smoothly at first successful build after changing lot of stuff! :)
Here the set of changes i done: --------- * refactor signaling low space semaphore * refactor signaling interrupt semaphore * refactor signaling finalization semaphore * remove interruptPending var * remove get/setInterruptPending methods
* set system timer to post ioProcessEvents event every 200 ms
* deal with primitiveSignalAtMilliseconds primitive * refactor signaling timer semaphore * remove lastTick var * remove nextPollTick var * remove nextWakeupTick var * remove get/setNextWakeupTick methods
* change internalQuickCheckForInterrupts * remove quickCheckForInterrupts, leave only internalQuickCheckForInterrupts
* remove checkForInterrupts method * interruptChecksEveryNms totally ignored (no need in interrupt if there no any event!) * remove interruptCheckForced method from use * remove getInterruptCheckCounter method * remove setInterruptCheckCounter: method * remove interruptCheckCounter var * forceInterruptCheck method is no-op now * remove interruptCheckCounterFeedBackReset var
---------
1 tinyBenchmarks runs on my box:
squeak VM: '200312989 bytecodes/sec; 5879195 sends/sec' '200469851 bytecodes/sec; 6178049 sends/sec' '200000000 bytecodes/sec; 6183469 sends/sec' '200156372 bytecodes/sec; 6151095 sends/sec'
HydraVM before refactoring of checkForInterrupts()
'194973343 bytecodes/sec; 5372831 sends/sec' '195121951 bytecodes/sec; 5372831 sends/sec' '195121951 bytecodes/sec; 5368739 sends/sec' '194973343 bytecodes/sec; 5126658 sends/sec'
HydraVM after refactoring of checkForInterrupts() '197378565 bytecodes/sec; 5183202 sends/sec' '195121951 bytecodes/sec; 5126658 sends/sec' '197378565 bytecodes/sec; 5308098 sends/sec' '197530864 bytecodes/sec; 5368739 sends/sec'
It's strange that [ 3000 milliSeconds asDelay wait ] timeToRun prints 2500 ( 4000 milliSeconds will print 3500, seems somewhere there is a constant subtraction placed ?)
Is there are some tests for how precise Delays working?
Okay, now need to do some testing, and then i will release the update.