Home Online Manual
Top
Back: waitTasks
Forward: pollTask
FastBack: resources_lib
FastForward: derham_lib
Up: tasks_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.15.20.9 waitAllTasks

Procedure from library tasks.lib (see tasks_lib).

Usage:
waitAllTasks(t1, t2, ...), t1, t2, ... tasks

Return:
nothing. Waits for all the tasks t1, t2, ... to complete. The state of the tasks is set to 'completed'.

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.
'waitAllTasks(t1, t2, ...);' is a shortcut for 'waitTasks(list(t1, t2, ...), size(list(t1, t2, ...)));'. Since returning a list of the indices of the completed tasks does not make sense in this case, nothing is returned.

Example:
 
LIB "tasks.lib";
ring R = 0, (x,y), dp;
ideal I = x9y2+x10, x2y7-y8;
task t1 = "std", list(I);
task t2 = "slimgb", list(I);
startTasks(t1, t2);
waitAllTasks(t1, t2);   // the same as 'waitTasks(list(t1, t2), 2);',
// but without return value
getResult(t1);
==> _[1]=x2y7-y8
==> _[2]=x9y2+x10
==> _[3]=x12y+xy11
==> _[4]=x13-xy12
==> _[5]=y14+xy12
==> _[6]=xy13+y12
getResult(t2);
==> _[1]=x2y7-y8
==> _[2]=x9y2+x10
==> _[3]=x12y+xy11
==> _[4]=x13-xy12
==> _[5]=xy13+y12
==> _[6]=y14+xy12
killTask(t1);
killTask(t2);
See also: getResult; getState; pollTask; printTask; startTasks; waitTasks.