mirror of
https://github.com/python/cpython.git
synced 2025-08-24 10:45:53 +00:00
gh-115999: Add free-threaded specialization for FOR_ITER (#128798)
Add free-threaded versions of existing specialization for FOR_ITER (list, tuples, fast range iterators and generators), without significantly affecting their thread-safety. (Iterating over shared lists/tuples/ranges should be fine like before. Reusing iterators between threads is not fine, like before. Sharing generators between threads is a recipe for significant crashes, like before.)
This commit is contained in:
parent
db27aee2fe
commit
de2f7da77d
13 changed files with 469 additions and 125 deletions
|
@ -363,6 +363,7 @@ _PyUOp_Replacements[MAX_UOP_ID + 1] = {
|
|||
[_ITER_JUMP_LIST] = _GUARD_NOT_EXHAUSTED_LIST,
|
||||
[_ITER_JUMP_TUPLE] = _GUARD_NOT_EXHAUSTED_TUPLE,
|
||||
[_FOR_ITER] = _FOR_ITER_TIER_TWO,
|
||||
[_ITER_NEXT_LIST] = _ITER_NEXT_LIST_TIER_TWO,
|
||||
};
|
||||
|
||||
static const uint8_t
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue