Macaulay2 » Documentation
Packages » Macaulay2Doc > The Macaulay2 language > parallel programming with threads and tasks > addDependencyTask(Task,Task)
next | previous | forward | backward | up | index | toc

addDependencyTask(Task,Task) -- schedule a task, but ensure that it will not run until another task finishes

Synopsis

Description

i1 : for i to 5 do t_i = createTask(() -> i)
i2 : for i from 1 to 5 do addDependencyTask(t_i, t_(i - 1))
i3 : schedule t_0

o3 = <<task, created>>

o3 : Task
i4 : while not isReady t_5 do nanosleep 1000000
i5 : taskResult t_5

o5 = 5

Ways to use this method: