[Next] [Up] [Previous]

The START, WAIT and CANCEL Statements

The START and WAIT Statements

The second is the START statement:

       START id-number:node,sequence

which starts the actions in the given sequence taking place, but does not wait for them to finish: instead, the statement:

       WAIT id-number

causes execution to wait for the completion of the sequence STARTed with the same id-number, now that presumably its results are needed.

The CANCEL Statement

The statement

       CANCEL id-number

will halt a parallel process, without waiting for it to finish, withdrawing all machine resources from it, which is useful if one parallel process can determine that another process is no longer relevant.

Even most conventional computers perform input/output at the same time as calculations, either because they have special-purpose added processors for input/output, or because they return to computations while waiting for external devices to supply or absorb information one piece at a time. Thus, the WAIT statement above is also used with some special input-output statements (placing an input-output statement alone in a sequence may fail to be recognized properly in simpler implementations).

The id-number parameter identifies a concurrently running procedure to the procedure that initiated it. The optional node parameter can be used to specify which real (or virtual) processor is to perform a task.

Multiple tasks can also be started by putting a START statement in a loop; remember that the computer does not wait for them to be finished until the appropriate WAIT statement is executed.


[Next] [Up] [Previous]