> I still like the idea of being able to sleep and wake in the MIDDLE of code 
> (rather than only being able to start at the beginning of a > function), so 
> we should consider adding a feature that can do long_jmp as well.

For portability and maintainability sake I would argue against it.  Because of 
the use case we are discussing, a time step based simulator, you would not 
sleep with actions pending from the current timestep.  In other words, all 
actions taken between two sleep points must be resolved and complete before 
sleeping.  This means that the set of actions is self contained with some input 
state from the prior timestep and some output state for the next timestep.  
These can easily be encapsulated in a function and use class private variables 
for state information.  Determining which function gets executed for a timestep 
can be done in a case statement and/or using function pointers.

Either that, or I am missing a use case for sleeping in the middle of a chunk 
of simulation code.

Patrick M 
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to