Skip to content

Commit a8c2e44

Browse files
committed
pythongh-128691: Use deferred reference counting on _thread._local
This change, along with the LOAD_ATTR specializations, makes the "thread_local_read" micro benchmark in Tools/ftscalingbench/ftscalingbench.py scale well to multiple threads.
1 parent 7dc41ad commit a8c2e44

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: Modules/_threadmodule.c

+1
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,7 @@ local_new(PyTypeObject *type, PyObject *args, PyObject *kw)
14351435
Py_DECREF(localsdict);
14361436
Py_DECREF(sentinel_wr);
14371437

1438+
_PyObject_SetDeferredRefcount((PyObject *)self);
14381439
return (PyObject *)self;
14391440

14401441
err:

0 commit comments

Comments
 (0)