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

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

Synopsis

Description

i1 : threadLocal x

o1 = x

o1 : Symbol
i2 : x = 1

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

o3 = <<task, created>>

o3 : Task
i4 : taskResult t

o4 = 2
i5 : x

o5 = 1

For the programmer

The object threadLocal is a keyword.