Skip to content

value is not thread-safe #3927

@mahrud

Description

@mahrud

After lots of confusion I think I tracked down the issue that makes lots of things not thread safe (including basis and truncate, which is possibly related to #3439). value can't handle symbols in parallel:

i1 : R = QQ[x];

i2 : taskResult \ apply(5, i -> schedule(() -> value "x"))
../linuxbrew/.linuxbrew/Cellar/macaulay2/1.25.06_2/share/Macaulay2/Core/debugging.m2:18:13:(1):[5]: error: mutable unexported unset symbol(s) in package User: 'T'
null: here is the first use of 'T'
../linuxbrew/.linuxbrew/Cellar/macaulay2/1.25.06_2/share/Macaulay2/Core/packages.m2:491:15:(1):[4]: --back trace--
../linuxbrew/.linuxbrew/Cellar/macaulay2/1.25.06_2/share/Macaulay2/Core/packages.m2:289:27:(1):[3]: --back trace--
../linuxbrew/.linuxbrew/Cellar/macaulay2/1.25.06_2/share/Macaulay2/Core/methods.m2:458:27:(1):[2]: --back trace--

o2 = {x, , x, x, x}

o2 : List

Strangely, value is simply a wrapper around the compiled function value', and using value' above we also get the same crash, so this isn't even a top-level issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions