Macaulay2 » Documentation
Packages » Macaulay2Doc > The Macaulay2 language > parallel programming with threads and tasks > threadVariable
next | previous | forward | backward | up | index | toc

threadVariable -- create a symbol whose value in one thread is not shared with others

Synopsis

Description

i1 : threadVariable x

o1 = x

o1 : Symbol
i2 : x = 1

o2 = 1
i3 : t = schedule ( () -> ( x = 2 ; x ) )

o3 = <<task, created>>

o3 : Task
i4 : while not isReady t do null
i5 : taskResult t

o5 = 2
i6 : x

o6 = 1

For the programmer

The object threadVariable is a keyword.