Suspending and Resuming Processes

You can interactively suspend execution of a process with the ST (Stop) system command, and resume execution of the process with an OK (Reactivate) system command. You can design a program to achieve the same result by assigning the STATUS task attribute a value of SUSPENDED or ACTIVE. However, note that if the process is suspended by the system, the OK command or ACTIVE assignment frequently is not enough to resolve the cause of the suspension. In this case, the process is suspended again by the system without progressing any further in its execution.

One reason to suspend a process programmatically is for testing. For example, you can add a statement in a program that causes it to be suspended at a certain point where a problem has been occurring. Then, you can force a memory dump or program dump through the DUMP (Dump Memory) system command, with the knowledge that the dump will reflect the state of the process at a selected point in its execution.

Parallel processes can also use assignments of SUSPENDED or ACTIVE as a means of coordinating their activities. However, the system provides special variables called events that are better suited to coordinating parallel processes. For details, refer to Using Events and Interlocks.