## APL (Child task) Object

### Description

The `APL` object allows you to create APL child tasks under program control. They can either be background 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.

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 signals to allow parent and child tasks to communicate with one another. In addition, variables can be shared between tasks. The niladic system function ŚUL returns the number of APLX tasks which are currently running.

If you are running a Client-Server implementation of APLX, you can set the `host` property of the APL object to specify on which machine the new APL task should run.

See the separate section on APLX Multi-tasking for more details.

### Example

         ’DEMO_APL;ChildTask
    [1]   © Sample function demonstrating use of the APL object
    [2]   ChildTask„'Ś' ŚNEW 'APL'
    [3]   ChildTask.wssize„100000
    [4]   ChildTask.Open
    [5]   ChildTask.Execute '"There are now ",(•ŚUL)," APLX tasks running"'
    [6]   0 0˝ŚDL 5
    [7]   © ChildTask will be deleted when function ends
         ’

### Properties

background children class data events extent host methods name opened port properties scale self size status taskid text tie visible where wssize

### Methods

Close Create Delete Execute Hide Interrupt New Open Send Set Show Signal Trigger

### Callbacks

onClose onDestroy onError onExecute onOpen onReady onSend onSignal

Topic: APLX Help : System Classes : List of Classes : APL

[ Next | Contents | Index ]