-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
gh-142518: add thread safety docs for set C-APIs #146562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
e4c4aef
94e92a5
445bffb
5e527aa
f00cfa6
da5aac8
cce95cc
1d5ab85
14101e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,6 +125,28 @@ PyByteArray_GET_SIZE:atomic: | |
| PyByteArray_AsString:compatible: | ||
| PyByteArray_AS_STRING:compatible: | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may add PySet_Check(), PyFrozenSet_Check(), PyAnySet_Check(), PySet_CheckExact(), PyAnySet_CheckExact() and PyFrozenSet_CheckExact() functions, they are atomic.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am thinking of covering this and other type checks in next PR, so skipping this for now |
||
| # Creation - may iterate the iterable argument, calling arbitrary code | ||
| # atomic for sets, dicts, and frozendicts. | ||
kumaraditya303 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| PySet_New:shared: | ||
| PyFrozenSet_New:shared: | ||
|
|
||
| # Size - uses atomic load on free-threaded builds | ||
| PySet_Size:atomic: | ||
| PySet_GET_SIZE:atomic: | ||
|
|
||
| # Contains - lock-free, atomic with simple types | ||
kumaraditya303 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| PySet_Contains:shared: | ||
|
|
||
| # Mutations - hold per-object lock for duration | ||
| # atomic with simple types | ||
| PySet_Add:shared: | ||
| PySet_Discard:shared: | ||
|
|
||
| # Pop - hold per-object lock for duration; | ||
kumaraditya303 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| PySet_Pop:atomic: | ||
|
|
||
| # Clear - empties the set before clearing | ||
| PySet_Clear:atomic: | ||
| # Capsule objects (Doc/c-api/capsule.rst) | ||
kumaraditya303 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Type check - read ob_type pointer, always safe | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.