Tin mới
Time complexity of operations on built-in types
This page documents thread-safety guarantees for built-in types in Python’s free-threaded build. The guarantees described here apply when using Python with the GIL disabled (free-threaded mode). When the GIL is enabled,
Python support for free threading
This page documents thread-safety guarantees for built-in types in Python’s free-threaded build. The guarantees described here apply when using Python with the GIL disabled (free-threaded mode). When the GIL is enabled,
A function or operation that is safe for concurrent use on the same object. The implementation uses internal synchronization (such as per-object locks or critical sections) to protect shared mutable state, so callers do
A function or operation that is safe for concurrent use on the same object. The implementation uses internal synchronization (such as per-object locks or critical sections) to protect shared mutable state, so callers do
Thread safety for list objects¶
The following methods traverse the list and use atomic reads of each item to perform their function. That means that they may return results affected by concurrent modifications:
Thread safety for list objects¶
The following methods traverse the list and use atomic reads of each item to perform their function. That means that they may return results affected by concurrent modifications:
Thread safety for dict objects¶
Creating a dictionary with the dict constructor is atomic when the argument to it is a dict or a tuple. When using the dict.fromkeys() method, dictionary creation is atomic when the argument is a dict, tuple, set or froz