Top
Back: stopTask
Forward: waitAllTasks
FastBack: resources_lib
FastForward: schubert_lib
Up: tasks_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.15.22.8 waitTasks

Procedure from library tasks.lib (see tasks_lib).

Usage:
waitTasks(T, N[, timeout]), T list of tasks, N int, timeout int

Return:
an ordered list of the indices of those tasks which have been successfully completed. The state of these tasks is set to 'completed'.
The procedure waits for N tasks to complete.
An optional timeout in ms can be provided. Default is 0 which disables the timeout.

Note:
A task whose state is neither 'started' nor 'completed' cannot be waited for.
The result of any completed task can be accessed via getResult.
The returned list may contain more than N entries if the computation of some tasks has already finished and/or if several tasks finish "at the same time". It may contain less than N entries in the case of timeout or errors occurring.
Polling is guaranteed, i.e. the index of any task t for which 'pollTask(t);' would return 1 will appear in the returned list.

Example:
 
See also: getResult; getState; pollTask; printTask; startTasks.


Top Back: stopTask Forward: waitAllTasks FastBack: resources_lib FastForward: schubert_lib Up: tasks_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-7, Aug 2013, generated by texi2html.