On Monday 24 September 2001 11:54 am, Dan Sugalski wrote:
> 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.
Embed (them) within an outer loop (function). Program end would propogate
the finish. Otherwise, simply redirect to a new runops routine.
Potentially increases the call-stack by one, but performance hit only occurs
during the switch. Or you could collapse it all, if you have a fixed
number, into a switch.
runops ( ... )
{
run_ops_t run_ops_type= BLUE_MOON;
while (opcode != END) {
switch (run_ops_type) {
/* I want those events checked... */
case (YESTERDAY) {
while (opcode == VALID) { DO_OP1() } break;
}
/* Check the events every... */
case (NOW_AND_THEN) {
while (opcode == VALID) { DO_OP2() } break;
}
/* Look for an event once in a... */
case (BLUE_MOON) {
while (opcode == VALID) { DO_OP3() } break;
}
/* I'll check for an event when... */
case (HELL_FREEZES_OVER) {
while (opcode == VALID) { DO_OP4() } break;
}
}
run_ops_type = new_runops_loop(I,opcode);
}
/* yada yada yada */
}
--
Bryan C. Warnock
[EMAIL PROTECTED]