Skip to content

STOP is not cooperative. #87

@python-processing-unit

Description

@python-processing-unit

According to the specification section 9.1.9:

THR: STOP(THR: thread) = MUST cooperatively stop thread, mark it finished, and return the resulting handle.

In the implementation, however, STOP only marks the handle as finished. The worker keeps running, so a supposedly stopped thread can still continue executing, and AWAIT can block indefinitely on it.

Prefix REPL. Enter statements, blank line to run buffer.
>>> THR(t){ WHILE(0d1){} }
>>> STOP(t)
>>> AWAIT(t)

AWAIT does not return here, as the worker was never actually stopped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions