Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f18939a
Initial fix.
ZeroIntensity Nov 10, 2024
756bf41
Remove junk file.
ZeroIntensity Nov 10, 2024
45c4561
Merge branch 'main' of https://github.com/python/cpython into interp-…
ZeroIntensity Nov 10, 2024
a94eaef
Don't overwrite the main thread.
ZeroIntensity Nov 10, 2024
206b581
Small changes.
ZeroIntensity Nov 10, 2024
286e536
Put lock around exception capturing.
ZeroIntensity Nov 10, 2024
2fab7af
Add a comment.
ZeroIntensity Nov 10, 2024
446abc1
Add blurb.
ZeroIntensity Nov 10, 2024
cc36e8d
Add a test.
ZeroIntensity Nov 10, 2024
e25587e
Skip test on the default build.
ZeroIntensity Nov 10, 2024
e4b2c79
Fix and move tests.
ZeroIntensity Nov 10, 2024
aeb483e
Somehow, the locks are re-entrant.
ZeroIntensity Nov 10, 2024
92b3ea7
Don't rely on the interpreter state for _PyXI_ERR_ALREADY_RUNNING
ZeroIntensity Nov 11, 2024
804c41e
Throw an exception if there's a remaining thread state.
ZeroIntensity Nov 11, 2024
2edfda3
Remove newline.
ZeroIntensity Nov 11, 2024
bb8feee
Remove another newline.
ZeroIntensity Nov 11, 2024
5968448
Add docstrings.
ZeroIntensity Nov 11, 2024
9ab979d
Protect _PyIndexPool_AllocIndex with the runtime lock.
ZeroIntensity Nov 11, 2024
b478375
Bump the thread count.
ZeroIntensity Nov 11, 2024
f393ab6
Add comments to the test.
ZeroIntensity Nov 11, 2024
35323f8
Re-enable subinterpreter tests for the free-threaded build.
ZeroIntensity Nov 11, 2024
67df772
Fix tests.
ZeroIntensity Nov 11, 2024
13e96de
Lock runtime instead of using pyatomic
ZeroIntensity Nov 11, 2024
c9e7b08
Fix failing builds.
ZeroIntensity Nov 11, 2024
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
Add a test.
  • Loading branch information
ZeroIntensity committed Nov 10, 2024
commit cc36e8d9f2b7b71767d11074c83ee7b27d41b9da
8 changes: 8 additions & 0 deletions Lib/test/test_interpreters/test_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ def task():
with threading_helper.start_threads(threads):
pass

@support.requires_resource('cpu')
def test_subinterpreter_thread_safety(self):
interp = interpreters.create()
threads = [threading.Thread(target=interpreters.run_string, args=(interp,)) for _ in range(200)]
threads.extend([threading.Thread(target=interpreters.destroy, args=(interp,)) for _ in range(200)])
with threading_helper.start_threads(threads):
pass


if __name__ == '__main__':
# Test needs to be a package, so we can do relative imports.
Expand Down