cpython/Lib/test/test_free_threading
Sam Gross 3d4ac1a2c2
gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064)
Concurrent accesses from multiple threads to the same `cell` object did not
scale well in the free-threaded build. Use `_PyStackRef` and optimistically
avoid locking to improve scaling.

With the locks around cell reads gone, some of the free threading tests were
prone to starvation: the readers were able to run in a tight loop and the
writer threads weren't scheduled frequently enough to make timely progress.
Adjust the tests to avoid this.

Co-authored-by: Donghee Na <donghee.na@python.org>
2025-03-26 12:08:20 -04:00
..
__init__.py gh-120659: Skip `test_freethreading` with GIL (#120660) 2024-06-18 15:56:20 +02:00
test_code.py gh-127020: Make `PyCode_GetCode` thread-safe for free threading (#127043) 2024-11-21 11:00:50 -05:00
test_dict.py gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064) 2025-03-26 12:08:20 -04:00
test_enumerate.py gh-121464: Make concurrent iteration over enumerate safe under free-threading (#125734) 2025-03-14 00:14:05 +05:30
test_func_annotations.py gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064) 2025-03-26 12:08:20 -04:00
test_gc.py gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064) 2025-03-26 12:08:20 -04:00
test_iteration.py gh-115999: Make list and tuple iteration more thread-safe. (#128637) 2025-02-18 16:52:46 -08:00
test_itertools_batched.py gh-131152: Remove unused imports from tests (part 2) (#131154) 2025-03-13 10:57:40 +01:00
test_list.py gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064) 2025-03-26 12:08:20 -04:00
test_methodcaller.py gh-131152: Remove unused imports from tests (part 2) (#131154) 2025-03-13 10:57:40 +01:00
test_monitoring.py gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064) 2025-03-26 12:08:20 -04:00
test_races.py gh-128717: Stop-the-world when setting the recursion limit (#128741) 2025-01-12 18:34:30 +05:30
test_reversed.py gh-120608: Make reversed iterator work with free-threading (#120971) 2025-03-12 12:39:52 +01:00
test_set.py gh-129967: Fix race condition in `repr(set)` (gh-129978) 2025-02-11 17:29:27 -05:00
test_slots.py gh-117657: TSAN Fix races in `PyMember_Get` and `PyMember_Set` for C extensions (GH-123211) 2024-12-03 09:41:53 -05:00
test_str.py gh-120417: Remove unused imports in tests (part 2) (#120630) 2024-06-17 21:05:37 +02:00
test_tokenize.py gh-120317: Lock around global state in the tokenize module (#120318) 2024-07-16 11:35:57 +02:00
test_type.py gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064) 2025-03-26 12:08:20 -04:00
test_zip.py gh-123271: Make builtin zip method safe under free-threading (#123272) 2024-08-27 15:22:43 -04:00