Skip to content

A loop split between two hot executors never calls CHECK_EVAL_BREAKER() #117442

Description

@gvanrossum

When a tight for loop without calls is turned into two traces that transfer directly to each other, it seems that CHECK_EVAL_BREAKER() is never called, and the loop won't be interruptible.

See faster-cpython/ideas#669 (comment), where @brandtbucher and I reasoned that this might occur in the nbody benchmark (when the max trace length is reduced to 400).

While we didn't observe the predicted speedup, we really do believe that in this case the thread is uninterruptible.

@markshannon Any thoughts?

Linked PRs

Activity

  1. brandtbucher commented on Apr 2, 2024

    @brandtbucher
    Member

    Probably we should insert a _CHECK_PERIODIC at the beginning of a trace starting with JUMP_BACKWARD, rather than checking signals in _JUMP_TO_TOP. That way we also wouldn't need to check signals in ENTER_EXECUTOR, _JUMP_TO_TOP, and wherever else is necessary to fix this issue.

  2. added a commit that references this issue on May 2, 2024
  3. added a commit that references this issue on May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions