Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 20, 2020

If a thread different than the main thread schedules a pending call
(Py_AddPendingCall()), the bytecode evaluation loop is no longer
interrupted at each bytecode instruction to check for pending calls
which cannot be executed. Only the main thread can execute pending
calls.

Previously, the bytecode evaluation loop was interrupted at each
instruction until the main thread executes pending calls.

  • Add _Py_ThreadCanHandlePendingCalls() function.
  • SIGNAL_PENDING_CALLS() now only sets eval_breaker to 1 if the
    current thread can execute pending calls. Only the main thread can
    execute pending calls.

https://bugs.python.org/issue40010

If a thread different than the main thread schedules a pending call
(Py_AddPendingCall()), the bytecode evaluation loop is no longer
interrupted at each bytecode instruction to check for pending calls
which cannot be executed. Only the main thread can execute pending
calls.

Previously, the bytecode evaluation loop was interrupted at each
instruction until the main thread executes pending calls.

* Add _Py_ThreadCanHandlePendingCalls() function.
* SIGNAL_PENDING_CALLS() now only sets eval_breaker to 1 if the
  current thread can execute pending calls. Only the main thread can
  execute pending calls.
@vstinner vstinner merged commit d831688 into python:master Mar 20, 2020
@vstinner vstinner deleted the eval_break_subinterp branch March 20, 2020 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants