cpython/Python
Kirill Podoprigora 27486c3365
gh-115999: Add free-threaded specialization for UNPACK_SEQUENCE (#126600)
Add free-threaded specialization for `UNPACK_SEQUENCE` opcode.
`UNPACK_SEQUENCE_TUPLE/UNPACK_SEQUENCE_TWO_TUPLE` are already thread safe since tuples are immutable.
`UNPACK_SEQUENCE_LIST` is not thread safe because of nature of lists (there is nothing preventing another thread from adding items to or removing them the list while the instruction is executing). To achieve thread safety we add a critical section to the implementation of `UNPACK_SEQUENCE_LIST`, especially around the parts where we check the size of the list and push items onto the stack.


---------

Co-authored-by: Matt Page <mpage@meta.com>
Co-authored-by: mpage <mpage@cs.stanford.edu>
2024-11-22 19:00:35 +02:00
..
clinic gh-126579: Adapt sys.audit() to Argument Clinic (GH-126580) 2024-11-08 13:11:44 +00:00
frozen_modules
_warnings.c gh-126209: Fix inconsistency of skip_file_prefixes in warnings.warn's C and Python implementations (GH-126329) 2024-11-12 13:01:56 +01:00
asdl.c
asm_trampoline.S
assemble.c
ast.c
ast_opt.c
ast_unparse.c
bltinmodule.c gh-126757: fix minor typo (GH-126758) 2024-11-12 13:23:40 -08:00
bootstrap_hash.c
brc.c
bytecodes.c gh-115999: Add free-threaded specialization for UNPACK_SEQUENCE (#126600) 2024-11-22 19:00:35 +02:00
ceval.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
ceval_gil.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
ceval_macros.h gh-120619: Strength reduce function guards, support 2-operand uop forms (GH-124846) 2024-11-09 11:35:33 +08:00
codecs.c
codegen.c gh-126072: Set docstring attribute for module and class (#126231) 2024-11-08 15:13:18 +00:00
compile.c gh-120017: use 'do-while(0)' in some {codegen,compile}.c multi-line macros (#120018) 2024-11-07 23:03:11 +00:00
condvar.h
config_common.h
context.c
critical_section.c
crossinterp.c gh-126986: Drop _PyInterpreterState_FailIfNotRunning() (gh-126988) 2024-11-19 00:11:12 +00:00
crossinterp_data_lookup.h gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707) 2024-11-12 10:41:51 -07:00
crossinterp_exceptions.h gh-76785: Minor Cleanup of Exception-related Cross-interpreter State (gh-126602) 2024-11-11 14:49:41 -07:00
dtoa.c
dup2.c
dynamic_annotations.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
emscripten_signal.c
emscripten_trampoline.c
errors.c
executor_cases.c.h gh-115999: Add free-threaded specialization for UNPACK_SEQUENCE (#126600) 2024-11-22 19:00:35 +02:00
fileutils.c gh-126780: Fix ntpath.normpath() for drive-relative paths (GH-126801) 2024-11-21 14:43:36 +00:00
flowgraph.c
formatter_unicode.c
frame.c gh-115999: Implement thread-local bytecode and enable specialization for BINARY_OP (#123926) 2024-11-04 11:13:32 -08:00
frozen.c
frozenmain.c
future.c
gc.c GH-127010: Don't lazily track and untrack dicts (GH-127027) 2024-11-20 16:41:20 +00:00
gc_free_threading.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
gc_gil.c
generated_cases.c.h gh-115999: Add free-threaded specialization for UNPACK_SEQUENCE (#126600) 2024-11-22 19:00:35 +02:00
getargs.c gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
getcompiler.c
getcopyright.c gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
getopt.c
getplatform.c
getversion.c
hamt.c
hashtable.c
import.c gh-126688: Reinit import lock after fork (#126692) 2024-11-12 15:53:58 -05:00
importdl.c
index_pool.c gh-115999: Implement thread-local bytecode and enable specialization for BINARY_OP (#123926) 2024-11-04 11:13:32 -08:00
initconfig.c gh-115999: Implement thread-local bytecode and enable specialization for BINARY_OP (#123926) 2024-11-04 11:13:32 -08:00
instruction_sequence.c
instrumentation.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
interpconfig.c
intrinsics.c
jit.c GH-126195: Use M1 JIT memory protection APIs (GH-126196) 2024-11-11 17:20:10 -08:00
legacy_tracing.c
lock.c
marshal.c gh-125063: marshal: Add version 5, improve documentation (GH-126829) 2024-11-15 13:48:57 +01:00
modsupport.c
mysnprintf.c
mystrtoul.c
object_stack.c
opcode_targets.h
optimizer.c gh-115999: Specialize LOAD_GLOBAL in free-threaded builds (#126607) 2024-11-21 11:22:21 -08:00
optimizer_analysis.c gh-120619: Strength reduce function guards, support 2-operand uop forms (GH-124846) 2024-11-09 11:35:33 +08:00
optimizer_bytecodes.c gh-120619: Strength reduce function guards, support 2-operand uop forms (GH-124846) 2024-11-09 11:35:33 +08:00
optimizer_cases.c.h gh-120619: Strength reduce function guards, support 2-operand uop forms (GH-124846) 2024-11-09 11:35:33 +08:00
optimizer_symbols.c
parking_lot.c gh-76785: Improved Subinterpreters Compatibility with 3.12 (1/2) (gh-126704) 2024-11-11 15:58:46 -07:00
pathconfig.c
perf_jit_trampoline.c
perf_trampoline.c
preconfig.c
pyarena.c Chore: Fix typo in pyarena.c (#126527) 2024-11-07 16:37:41 +01:00
pyctype.c
pyfpe.c
pyhash.c
pylifecycle.c
pymath.c
pystate.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
pystrcmp.c
pystrhex.c
pystrtod.c
Python-ast.c
Python-tokenize.c
pythonrun.c
pytime.c
qsbr.c
README
specialize.c gh-115999: Add free-threaded specialization for UNPACK_SEQUENCE (#126600) 2024-11-22 19:00:35 +02:00
stdlib_module_names.h
structmember.c
suggestions.c
symtable.c gh-126072: Set docstring attribute for module and class (#126231) 2024-11-08 15:13:18 +00:00
sysmodule.c gh-126579: Adapt sys.audit() to Argument Clinic (GH-126580) 2024-11-08 13:11:44 +00:00
thread.c
thread_nt.h
thread_pthread.h
thread_pthread_stubs.h
tier2_engine.md
traceback.c
tracemalloc.c
uniqueid.c
vm-state.md

Miscellaneous source files for the main Python shared library