-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Implement PaddedSpinLock
, which avoids false sharing.
#55944
base: master
Are you sure you want to change the base?
Conversation
Defines a new `AbstractSpinLock` with `SpinLock <: AbstractSpinLock` and `PaddedSpinLock <: AbstractSpinLock`. Fixes 55942.
Explanations for the labels, given that this is your first PR: Marking as "needs docs" because the doc string should be included into the documentation document (HTML/PDF). Marking as "needs news" because there's no news entry added, see NEWS.md. |
Co-authored-by: Neven Sajko <[email protected]>
Co-authored-by: Neven Sajko <[email protected]>
The doc strings may be included into the built docs by adding the lines for the new types around here: julia/doc/src/base/multi-threading.md Line 66 in bb25910
|
@@ -53,6 +53,26 @@ if threadpoolsize() > 1 | |||
end | |||
end | |||
|
|||
if threadpoolsize() > 1 |
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.
AFAIK it's a good idea to wrap new tests into a @testset
.
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.
done
Why introduce a new |
If you are including the |
The unpadded |
I'm not sure whether that's true.. As I understand it (and I could be wrong) a |
Probably want to add a Line 5 in 32ad9e6
|
Thanks for the various suggestions and the help with process. |
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.
a small docs suggestion
remember to add the new type to the online documentation by adding it here:
julia/doc/src/base/multi-threading.md
Line 66 in bb25910
Base.Threads.SpinLock |
and either mark it public
or export
it
Pending review comments LGTM! |
Co-authored-by: Nick Robinson <[email protected]>
Co-authored-by: Nick Robinson <[email protected]>
The test failures look real. |
Implemented
PaddedSpinLock
to help avoid false sharing.Defines a new
AbstractSpinLock
withSpinLock <: AbstractSpinLock
andPaddedSpinLock <: AbstractSpinLock
.Fixes #55942.