Next: Step By Step Imperative Program Execution Considerations, Up: Step By Step Imperative Program Execution [Index]
There are quite a few reasons for which an application might want to execute programs instruction by instruction. Obvious ones would include execution length (duration that is) limitation. The application would count instructions (or the time they take) as they are executed and when it decides a threshold has been reached it may abort (stop) executing program.
Another reason is stopping program execution to performed other tasks. The latter may have been occasioned by the program execution itself, but the application may like to regain control when performing the tasks.
The said tasks may be of the same nature of those that are carried out through the exported functions, save the part where it would be more convenient to see to them outside program execution.
Or, it may be that the exported functions need to evaluate to results not yet available (because, for an instance, they are to be retrieved from an external party by issuing a request and receiving a response). The application would not like to stop while waiting for the results to become available and would interrupt program execution only to resume it once the results are in.