Home Online Manual
Top
Back: waitAllTasks
Forward: getCommand
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.10 pollTask

Procedure from library tasks.lib (see tasks_lib).

Usage:
pollTask(t), t task

Return:
1, if the computation of the task t has successfully finished; 0, otherwise.
The state of any task whose computation has successfully finished is set to 'completed'.

Note:
A task whose state is neither 'started' nor 'completed' cannot be polled.
The result of any completed task can be accessed via getResult.
pollTask() should return immediately. However, receiving the result of the task may take some time.

Example:
 
LIB "tasks.lib";
ring R = 0, (x,y), dp;
ideal I = x9y2+x10, x2y7-y8;
task t = "std", list(I);
startTasks(t);
waitAllTasks(t);
pollTask(t);   // task already completed
==> 1
t;
==> A task with the following properties:
==> command:          std
==> no. of arguments: 1
==> state:            completed
==> 
getResult(t);
==> _[1]=x2y7-y8
==> _[2]=x9y2+x10
==> _[3]=x12y+xy11
==> _[4]=x13-xy12
==> _[5]=y14+xy12
==> _[6]=xy13+y12
killTask(t);
See also: getResult; getState; printTask; startTasks; waitTasks.