Home Online Manual
Top
Back: killTask
Forward: compareTasks
FastBack:
FastForward:
Up: tasks_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.12.3 copyTask

Procedure from library tasks.lib (see tasks_lib).

Usage:
copyTask(t), t task

Return:
a copy of t.

Note:
'task t1 = copyTask(t2);' is not the same as 'task t1 = t2;'. After the latter command, t1 points to the same object as t2; any changes to t2 will also effect t1. In contrast to this, copyTask() creates a new independend task.
A task whose state is 'started' cannot be copied.

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