> >then what about a win/win? we could make the event checking style a
> >compile time option.
>
> Odds are you'll get per-op event checking if you enable debugging, since
> the debugging oploop will really be a generic "check event every op" loop
> that happens to have the "pending debugging event" bit permanently set.
> Dunno whether we want to force this at compile time or consider some way to
> set it at runtime. I'd really like to be able to switch oploops
> dynamically, but I can't think of a good way to do that efficiently.
>

long-jump!!!

runops(bla bla){
  setjmp(..);
  switch(flags) {
    fast_runops(bla bla);
    debug_runops(bla bla);
    trace_runops(bla bla);
    conservative_runops(bla bla);
    thread_safe_runops(bla bla);
  }
}

AUTO_OP sys_opcode_change_runops {
  bla bla
  set run-flags..
  longjmp(..)
}

In C++ I'd say throw the appropriate exception, but this is close enough.

This would work well for fake-threads too, since each thread might have a
different desired main-loop.  You'd have to do something like this if you
transitioned bewteen non-threaded and threaded anyway.

-Michael

Reply via email to