💾 Archived View for blitter.com › apl-books › APLX50 › APLX-manual › www.microapl.com › apl_help › c… captured on 2023-01-29 at 14:38:11.
⬅️ Previous capture (2022-07-17)
-=-=-=-=-=-=-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Introduction to APLX multi-tasking</TITLE> <META NAME="DESCRIPTION" CONTENT="APL language help page: Introduction to APLX multi-tasking"> <META NAME="KEYWORDS" CONTENT="Tasks,Multi-tasking,apl,aplx,apl help"> <!-- %%COMMON_HEAD%% --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <LINK rel="stylesheet" type="text/css" href="http://www.microapl.com/styles_apl_help.css"> <!-- %%END%%--> </HEAD> <body> <table> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm"><code>APLX Help</code></A> : <A HREF="ch_200.htm"><code>Multi-tasking support</code></A> : <A HREF="ch_200_010.htm"><code>Introduction to APLX multi-tasking</code></A> </center> <center> [ <A HREF="ch_200_020.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> <tr> <td width="120"> <a href="http://www.microapl.co.uk/apl/index.html"><img height="68" border="0" width="119" src="MicroAPL_logo.gif" alt="www.microapl.co.uk"></a> </td> <td align="left" valign="bottom"> <h1>Introduction to APLX multi-tasking</h1> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <hr> <p>APLX includes built-in support for multi-tasking. This means that a single instance of the APLX program can simultaneously run multiple APL tasks, each with its own workspace and optionally its own session window. (Technically, APLX runs as a single <i>process</i>, with multiple <i>threads</i>. One thread controls the user-interface, and each APL task has its own thread.) </p> <p>APLX tasks are of two types, 'top-level' or 'parent' tasks, and 'child' tasks. When APLX starts up, it creates the first top-level task automatically. Further top-level tasks are created using the File menu on the APLX session window, and each has its own session window in which you can enter APL expressions. A top-level task keeps running until one of the following occurs:</p> <ul> <li>You type <code>)OFF</code> in the task's session window, or your program executes <code>)OFF</code></li> <li>You select 'Close Session' from the File menu</li> <li>You close the session window</li> </ul> <p>When a top-level task ends, other top-level tasks are not affected. When all top-level tasks have finished, the APLX program terminates. If you select 'Exit APLX' from the File menu, all tasks terminate.</p> <p>Child tasks are created under program control using <code>⎕WI</code>. They can either be <i>background</i> tasks (with no session window), or alternatively they can be ordinary tasks with their own session windows, although these might be hidden. Child tasks may be terminated in the same ways as top-level tasks, but in addition they can be terminated under program control by the parent task. They will also terminate automatically if their parent task terminates. Child tasks can themselves create further child tasks.</p> <p>Each task has its own separate memory allocation for the workspace, of a size which you can specify. The tasks execute independently, but you can use <i>signals</i> to allow parent and child tasks to communicate with one another. In addition, variables can be shared between tasks. The niladic system function <code>⎕UL</code> returns the number of APLX tasks which are currently running.</p> <H2>Special considerations for Client-Server versions of APLX</H2> <p>If you are running a Client-Server implementation of APLX, it is possible for your various APLX tasks to run on different machines. This is true both for tasks created using the File menu, and for Child tasks. In the former case, you can specify where the task should be created using the dialog which appears when you select the New Session menu item. In the latter case, you select the Server on which the task should run using the <tt><A HREF="ch_030_030_0367.htm">host</A></tt> property of the APL Child Task object.</p> <p>If you are running APLX64, your APL sessions can comprise a mixture of 32-bit and 64-bit tasks.</p> <hr> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm"><code>APLX Help</code></A> : <A HREF="ch_200.htm"><code>Multi-tasking support</code></A> : <A HREF="ch_200_010.htm"><code>Introduction to APLX multi-tasking</code></A> </center> <center> [ <A HREF="ch_200_020.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> </table> <!-- %%COMMON_BODY_TAIL%% --> <p class="copyright">Copyright © 1996-2010 MicroAPL Ltd</p> <!-- %%END%% --> </body> </html>