8000 gh-104812: Run Pending Calls in any Thread by ericsnowcurrently · Pull Request #104813 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104812: Run Pending Calls in any Thread #104813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6e46450
Clear each pending call when popping it.
ericsnowcurrently May 22, 2023
3b18b7d
Call _Py_FinishPendingCalls() in Py_EndInterpreter().
ericsnowcurrently May 23, 2023
f8b483f
Factor out has_pending_calls().
ericsnowcurrently May 23, 2023
44df0bc
Skip the calls_to_do check in _Py_FinishPendingCalls().
ericsnowcurrently May 23, 2023
e2a0281
Factor out _PyEval_MakePendingCalls().
ericsnowcurrently May 23, 2023
61e5d3e
Explicitly restrict Py_MakePendingCalls() to the main thread.
ericsnowcurrently May 23, 2023
5af09f2
Factor out _make_pending_calls().
ericsnowcurrently May 23, 2023
72cc242
Add the mainthreadonly arg to _PyEval_AddPendingCall().
ericsnowcurrently May 23, 2023
88f7757
Always use the main interpreter for Py_AddPendingCall().
ericsnowcurrently May 23, 2023
d24fafb
Add _PyRuntime.ceval.pending_mainthread.
ericsnowcurrently May 23, 2023
1701fa3
Run per-interpreter pending calls in any thread.
ericsnowcurrently May 23, 2023
c6cfaca
Drop _Py_ThreadCanHandlePendingCalls().
ericsnowcurrently May 23, 2023
dc11024
Expand the handle_eval_breaker comment.
ericsnowcurrently May 25, 2023
6c3d06c
Do not require faulthandler for test.support.threading_helper.start_t…
ericsnowcurrently May 31, 2023
69ff9e6
Add tests.
ericsnowcurrently May 25, 2023
fdde46d
Add a NEWS entry.
ericsnowcurrently Jun 2, 2023
d9924b4
Merge branch 'main' into per-interpreter-pending-calls
ericsnowcurrently Jun 5, 2023
c1fb647
Skip the test if subinterpreters not supported.
ericsnowcurrently Jun 5, 2023
e06b6f7
Adjust UNSIGNAL_PENDING_CALLS().
ericsnowcurrently Jun 6, 2023
2fabab7
Be more careful in make_pending_calls().
ericsnowcurrently Jun 6, 2023
8445fc0
The main thread may be used by subinterpreters.
ericsnowcurrently Jun 6, 2023
a83a321
Factor out _next_pending_call().
ericsnowcurrently Jun 6, 2023
aca2a8c
has_pending_calls() -> maybe_has_pending_calls().
ericsnowcurrently Jun 6, 2023
fbf92e0
Merge branch 'main' into per-interpreter-pending-calls
ericsnowcurrently Jun 6, 2023
93e61c5
Merge branch 'main' into per-interpreter-pending-calls
ericsnowcurrently Jun 8, 2023
3e1bc1f
Merge branch 'main' into per-interpreter-pending-calls
ericsnowcurrently Jun 8, 2023
7b8b8da
Drop a dead import.
ericsnowcurrently Jun 12, 2023
90b3a1f
Clarify some comments.
ericsnowcurrently Jun 12, 2023
4f0068d
Add timeouts.
ericsnowcurrently Jun 12, 2023
d5d7b42
Implement the remaining tests.
ericsnowcurrently Jun 12, 2023
37d41cc
Drop prints.
ericsnowcurrently Jun 12, 2023
fc25a85
Ignore the global variable.
ericsnowcurrently Jun 13, 2023
177f161
Clarify comments.
ericsnowcurrently Jun 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
has_pending_calls() -> maybe_has_pending_calls().
  • Loading branch information
ericsnowcurrently committed Jun 6, 2023
commit aca2a8ca233249d69ffd0f6d7051cc21dacf045a
4 changes: 2 additions & 2 deletions Python/ceval_gil.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ handle_signals(PyThreadState *tstate)
}

static inline int
has_pending_calls(PyInterpreterState *interp)
maybe_has_pending_calls(PyInterpreterState *interp)
{
struct _pending_calls *pending = &interp->ceval.pending;
if (_Py_atomic_load_relaxed_int32(&pending->calls_to_do)) {
Expand Down Expand Up @@ -1068,7 +1068,7 @@ _Py_HandlePending(PyThreadState *tstate)
}

/* Pending calls */
if (has_pending_calls(tstate->interp)) {
if (maybe_has_pending_calls(tstate->interp)) {
if (make_pending_calls(tstate->interp) != 0) {
return -1;
}
Expand Down
0