Bug report
Bug description:
PyDict_AddWatcher, PyDict_ClearWatcher, PyDict_Watch, PyDict_Unwatch, and _PyDict_SendEvent are not safe to call concurrently in free-threaded builds. The shared callback array and per-dict _ma_watcher_tag can race when watchers are registered, removed, or triggered from multiple threads.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Note: Running test.test_free_threading.test_dict_watcher (added in #145233) emits tsan warnings in the free-threaded tsan build.
Bug report
Bug description:
PyDict_AddWatcher,PyDict_ClearWatcher,PyDict_Watch,PyDict_Unwatch, and_PyDict_SendEventare not safe to call concurrently in free-threaded builds. The shared callback array and per-dict _ma_watcher_tag can race when watchers are registered, removed, or triggered from multiple threads.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Note: Running
test.test_free_threading.test_dict_watcher(added in #145233) emits tsan warnings in the free-threaded tsan build.