December 28, 2011
TOPS-20 allows you to use multiple interactive programs simultaneously from a single login session. For example, in the middle of editing a document you can run other programs or commands, lookup help files, refer to e-mail messages, etc., and then return to your editing session in the same state you left it.
(Multiple non-interactive programs can be run using the TOPS-20 batch facility. See the TOPS-20 User's Guide chapter 10 "Using Batch".)
The functions described in this tutorial are equivalent to those on Unix systems invoked with the Ctrl-Z key and commands like fg, jobs, etc.
There are two ways to run multiple interactive programs in TOPS-20:
This method involves starting a new EXEC command level subordinate to your login EXEC. The state of your original program is preserved in your login EXEC while you run one or more programs in the child EXEC level. When done, you terminate the child EXEC and return to your original program.
*^C ! Return from program session to EXEC ^C ! (only single ^C will echo). @PUSH ! Start child EXEC instance. TOPS-20 Command processor 7(4168)-1 @MM ! Start a program in the child EXEC. ... ! Use program then exit. @POP ! Terminate child EXEC and return to ! parent EXEC. @CONTINUE ! Return to original program session. * ! Depending on the program you may ! continue entering commands or ! refresh the display.
With multiforking, you run multiple programs in the same EXEC by forking a separate address space to maintain each program's state. You can then move between the forks and their corresponding programs at will. You do not need to end a program before returning to a previously used program session, and may revisit any of the forked programs multiple times preserving each program's session status.
*^C ! Return from program session to EXEC ^C ! (only single ^C will echo). @KEEP ! Create separate address space for ! new program. @MM ! Start new program. ... ! Use program. MM>^C ! Return from second program to EXEC. @INFORMATION FORK-STATUS ! List forks in current EXEC. ! (Current fork marked with "=>".) TECO (1): Kept, ^C from IO wait at TYI+3, 0:00:00.0 => MM (2): ^C from IO wait at $COMND+3, 0:00:00.0 @FORK TECO ! Switch to original program's fork ! ("TECO"). @CONTINUE ! Return to original program session. ... ! Use original program. *^C ! Return to EXEC. @INFORMATION FORK-STATUS => TECO (1): Kept, ^C from IO wait at TYI+3, 0:00:00.0 MM (2): ^C from IO wait at $COMND+3, 0:00:00.0 @FORK MM ! Switch to second program fork ("MM"). @CONTINUE ! Resume second program session.
More information can be found in TOPS-20 User's Guide sections 8.6 "Running Programs Without Destroying Memory" and 8.7 "Running Multiple Programs".
CONTINUE => CONT INFORMATION FORK-STATUS => IN FO