Application programs supporting multiple contexts on a computer system
having an operating system supporting threads. The method comprises
processing a context processing instruction from the run-time application
program, evaluating said instruction in relation to program-flow control
yielding context-defining processing parameters, analyzing the
context-defining processing parameters from the execution context of the
context processing instruction in regard of program flow management by
threads, mapping the context-processing instruction to a selected thread
managing instruction, or to a selected set of thread managing
instructions, having a respective program flow control effect equivalent
to that of context-processing instruction, invoking the selected thread
managing instruction or the set thereof, together with selected
parameters so that that during runtime of the application program only
one thread is allowed to execute at a time, and the program state of a
thread is stored at a given point in time and is restored later from the
point in time.