Interrupt checking in HydraVM using event system

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Interrupt checking in HydraVM using event system

Igor Stasenko
 
Hello everyone,

I'd like to discuss a not-very-easy to understand topic, like
interrupt checking mechanism in squeak VM.

I introduced an event system in HydraVM: all external events to
Interpreter can be posted at any time using event queue without much
processor stall (i'm using atomic operations for that).
I really now considering to change interpret() loop to move out and
cleanup code concerning interrupts checking.

How it's currently done (how do i see it - please tell me if i'm wrong
with this):
there is an interruptCheckCounter which initialized to big number, and
in different places of interpret(), there are method, called
quickCheckForInterrupts, which decrements the counter, and if it falls
beyond zero, calls the checkForInterrupts() method which doing all
gory details  by checking many things , like user input events and any
external events like signaling semaphores. In the end, it resets
interruptCheckCounter back to big number.
There's also a functions like forceInterruptCheck, which simply sets
counter to zero, making checkForInterrupts be called as soon as
possible.

How i'm suggesting this can be done:
- change a quickCheckForInterrupts() to check if interpreter's event
queue is not empty,
and if so, return from interpret() , and outside there will be a code which will
handle all pending events, and then enter interpret() again.

- for periodical interrupt checking we could use a system timer, which
simply post an events periodically, making calls of
checkForInterrupts() at same time intervals.
This is more better than using an interruptCheckCounter, it will do
checks with more precise/regular intervals.

- for any other external events all you need to do is to post a new
event to interpreter's event queue.
Again, it's better because your event will be handled as soon as
possible, AND!! without calling common checkForInterrupts() procedure,
which is a bit cumbersome, in cases if your only intent was to signal
a semaphore.



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Interrupt checking in HydraVM using event system

Michael van der Gulik-2
 


On Thu, Feb 14, 2008 at 10:02 PM, Igor Stasenko <[hidden email]> wrote:

Hello everyone,

I'd like to discuss a not-very-easy to understand topic, like
interrupt checking mechanism in squeak VM.

I introduced an event system in HydraVM: all external events to
Interpreter can be posted at any time using event queue without much
processor stall (i'm using atomic operations for that).
I really now considering to change interpret() loop to move out and
cleanup code concerning interrupts checking.

 
<snip>


You want to check to make sure you're not having an adverse effect on performance.

Is there a commonly used benchmark (other than 1 tinyBenchmark) which we could use to determine what the slowdown or speedup is? Perhaps a large compilation?

Gulik.


--
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/
Reply | Threaded
Open this post in threaded view
|

Re: Interrupt checking in HydraVM using event system

Adrian Kuhn-3
 
Alas I can not help you.

But a question to all - what do we \cite{} w r t tiny benchmarks in a  
paper?

cheers,
AA

On 14 Feb 2008, at 21:32 , Michael van der Gulik wrote:

>
>
> On Thu, Feb 14, 2008 at 10:02 PM, Igor Stasenko  
> <[hidden email]> wrote:
>
> Hello everyone,
>
> I'd like to discuss a not-very-easy to understand topic, like
> interrupt checking mechanism in squeak VM.
>
> I introduced an event system in HydraVM: all external events to
> Interpreter can be posted at any time using event queue without much
> processor stall (i'm using atomic operations for that).
> I really now considering to change interpret() loop to move out and
> cleanup code concerning interrupts checking.
>
>
> <snip>
>
>
> You want to check to make sure you're not having an adverse effect  
> on performance.
>
> Is there a commonly used benchmark (other than 1 tinyBenchmark)  
> which we could use to determine what the slowdown or speedup is?  
> Perhaps a large compilation?
>
> Gulik.
>
>
> --
> http://people.squeakfoundation.org/person/mikevdg
> http://gulik.pbwiki.com/