Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Doc/library/ctypes.rst
Co-authored-by: Bénédikt Tran <[email protected]>
  • Loading branch information
ZeroIntensity and picnixz authored Jan 9, 2025
commit d6a4bc846a5932632c40643863c4d651b79ad4ce
2 changes: 1 addition & 1 deletion Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ In ctypes, reads and writes to a single object concurrently is safe, but not acr
>>> pointer_a = pointer(number)
>>> pointer_b = pointer(number)

In the above, it's only safe for one object to read and write to the address at once if the :term:`GIL` is disabled.
In the above, it's only safe for one object to read and write to the address at once if the GIL is disabled.
So, ``pointer_a`` can be shared and written to across multiple threads, but only if ``pointer_b``
is not also attempting to do the same. If this is an issue, consider using a :class:`threading.Lock`
to synchronize access to memory:
Expand Down