-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
[WIP] gh-123358: Update LOAD_DEREF to use stackref and atomic incref #124463
base: main
Are you sure you want to change the base?
Changes from all commits
b834dc5
ab34c92
536b6fc
05f0cf9
617c759
1b2b618
cea6813
a3a89f0
4ad83c1
ee3113d
a7c7181
90ef0d8
f16009c
9edf409
1c8e923
2ec1278
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 |
---|---|---|
|
@@ -16,7 +16,6 @@ extern "C" { | |
#include "pycore_pystate.h" // _PyInterpreterState_GET() | ||
#include "pycore_uniqueid.h" // _PyType_IncrefSlow | ||
|
||
|
||
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 wonder if in
That might avoid the threads spinning on updating the value when the value is in heavy contention and instead all of the atomic operations should just slowly proceed. |
||
#define _Py_IMMORTAL_REFCNT_LOOSE ((_Py_IMMORTAL_REFCNT >> 1) + 1) | ||
|
||
// This value is added to `ob_ref_shared` for objects that use deferred | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -41,6 +41,8 @@ race_top:tstate_is_freed | |||||||||||
race_top:type_modified_unlocked | ||||||||||||
race_top:write_thread_id | ||||||||||||
race_top:PyThreadState_Clear | ||||||||||||
# see: https://github.com/python/cpython/issues/117721 | ||||||||||||
race_top:lock_PyThread_release_lock | ||||||||||||
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. @colesbury found that there is a possible issue from cpython/Lib/test/lock_tests.py Lines 117 to 121 in 5e7eba0
|
||||||||||||
# Only seen on macOS, sample: https://gist.github.com/aisk/dda53f5d494a4556c35dde1fce03259c | ||||||||||||
race_top:set_default_allocator_unlocked | ||||||||||||
|
||||||||||||
|
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.
@colesbury Let's extract the utility function with separated PRs.