Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
e4c4aef94e92a5445bffb5e527aaf00cfa6da5aac8cce95cc1d5ab8514101e5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -125,6 +125,29 @@ PyByteArray_GET_SIZE:atomic: | ||
| PyByteArray_AsString:compatible: | ||
| PyByteArray_AS_STRING:compatible: | ||
| # Creation - may iterate the iterable argument, calling arbitrary code. | ||
| # Atomic for sets, frozensets, dicts, and frozendicts. | ||
| 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.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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 | ||
| 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.
Uh oh!There was an error while loading. Please reload this page. | ||
| # Type check - read ob_type pointer, always safe | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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