# Feature or enhancement I expect this to be implemented across multiple PRs. For context, here is the change from the `nogil-3.12` fork, but things might be done a bit differently in CPython 3.13: https://github.com/colesbury/nogil-3.12/commit/df4c51f82b. - [x] Most operations should acquire the list object lock using the critical section API. - [x] Accessing a single element should optimistically avoid locking for performance - [x] Iterators need some special handling - [x] list.sort ### Iterators For performance reasons, we don't want to acquire locks while iterating over lists. This means that list iterators have a lesser notion of thread-safety: multiple threads concurrently using the same *iterator* should not crash but may revisit elements. We should make clear in the documentation that iterators are not generally thread-safe. From an implementation point of view, we should use relaxed atomics to update the `it_index` variable. Additionally, we don't want to clear the `it_seq` reference to the list when the iterator is exhausted in `--disable-gil` builds. Doing so would pose thread-safety issues (in the "may segfault sense"). I don't expect this to pose any issues for real code. While it's fairly common to share lists between threads, it's rare to share the same iterator object between threads. <!-- gh-linked-prs --> ### Linked PRs * gh-113764 * gh-113863 * gh-114268 * gh-114582 * gh-114651 * gh-114843 * gh-114916 * gh-115471 * gh-115472 * gh-115605 * gh-115854 * gh-115875 * gh-116233 * gh-116237 * gh-116353 * gh-116529 * gh-116553 * gh-117438 <!-- /gh-linked-prs -->