tutes-dump/site-tutorials/twenex-multiprg.html
2020-07-11 10:24:46 +00:00

145 lines
4.5 KiB
HTML

<h1>Using Multiple Interactive Programs on TWENEX</h1>
<p>December 28, 2011</p>
<p>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.</p>
<p>(Multiple non-interactive programs can be run using the TOPS-20 batch
facility. See the TOPS-20 User's Guide<a href="#n1">[1]</a> chapter 10 "Using Batch".)</p>
<p>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.</p>
<p>There are two ways to run multiple interactive programs<a href="#n2">[2]</a> in TOPS-20:
<ol>
<li>Push/Pop: From an interactive session you run another program, then
return to the first program when the called program is complete.</li>
<li>Multiforking: You run two or more interactive programs in parallel
and switch among them as needed, preserving the program session state from the
last time you visited the program.</li>
</ol>
<h2>Push/Pop</h2>
<p>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.</p>
<pre>
*^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<a href="#n3">[3]</a> ! Return to original program session.
* ! Depending on the program you may
! continue entering commands or
! refresh the display.
</pre>
<h2>Multiforking</h2>
<p>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.</p>
<pre>
*^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<a href="#n3">[3]</a>
! 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.
</pre>
<h2>More Information</h2>
<p>More information can be found in TOPS-20 User's Guide<a href="#n1">[1]</a> sections 8.6
"Running Programs Without Destroying Memory" and 8.7 "Running Multiple
Programs".</p>
<h2>Notes</h2>
<dl>
<dt><a name="n1">[1]</dt><dd>TOPS-20 User's Guide. Available on Twenex.org in file
DOC:USERS.MEM or on the WWW at <a href="http://tilt.twenex.org/">http://tilt.twenex.org/</a>.</dd>
<dt><a name="n2">[2]</dt><dd>It is only necessary to use these methods when you wish to use two
or more user programs at the same time. Running a user program
from EXEC without first running PUSH or KEEP will overwrite the
user program address space and destroy the session state of the
previously running program. However, EXEC commands generally do
not disturb user program address space. You can halt an active
program (with ^C^C), run several EXEC commands (e.g. DIRECTORY,
HELP, TYPE), and return to your original program (with CONTINUE) in
the state you left it.</dd>
<dt><a name="n3">[3]</dt><dd>EXEC commands and options may be abbreviated to the minimum unique
prefix, for example:
<pre>
CONTINUE => CONT
INFORMATION FORK-STATUS => IN FO
</pre>
</dd>
</dl>
<hr>
$Id: twenex-multiprg.html,v 1.2 2011/12/28 09:43:56 papa Exp $