Home Online Manual
Top
Back: printTask
Forward: stopTask
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.6 startTasks

Procedure from library tasks.lib (see tasks_lib).

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

Return:
nothing. Starts the tasks t1, t2, ... and sets their states to 'started'.

Note:
A task whose state is neither 'created' nor 'stopped' cannot be started.
If startTasks() is applied to a task whose state is 'stopped', then the computation of this task will be restarted from the beginning.
Tasks can be started from within other tasks. A started task should not be accessed from within any task other than the one within which it was started.
For each task, the start of its computation is subject to the internal scheduling.

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);
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: createTask; getState; pollTask; printTask; stopTask; waitTasks.