Skip to content
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

Allow for work stealing when only holding read locks #4012

Merged
merged 19 commits into from
Sep 21, 2024

Conversation

marcphilipp
Copy link
Member

@marcphilipp marcphilipp commented Sep 19, 2024

This allows tasks with only read locks to be stolen by threads that are
currently holding only read locks.

This allows tasks with only read locks to be stolen by threads that are
currently holding only read locks. The new compatibility check would
also support write locks but `NodeTreeWalker` forces children of tasks
with write locks to be executed on the same thread and thus no work is
being stolen.
@marcphilipp marcphilipp self-assigned this Sep 19, 2024
@marcphilipp marcphilipp added this to the 5.10.4 milestone Sep 19, 2024
@marcphilipp
Copy link
Member Author

Actually, I think we can get rid of the special types for the global locks now. I'll add that to this PR before merging.

@marcphilipp marcphilipp marked this pull request as draft September 19, 2024 11:53
@marcphilipp marcphilipp marked this pull request as ready for review September 19, 2024 12:36
@marcphilipp marcphilipp force-pushed the marc/lock-compatibility-checking branch from 9edf0e0 to 1fb9268 Compare September 19, 2024 12:59
@marcphilipp marcphilipp modified the milestones: 5.10.4, 5.11.1 Sep 19, 2024
Copy link
Collaborator

@leonard84 leonard84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good. Only some test suggestions and style bikeshedding left.

@marcphilipp marcphilipp changed the title Allow work stealing when more locks can be acquired without deadlock Allow for work stealing when only holding read locks Sep 20, 2024
@marcphilipp marcphilipp merged commit ebbf134 into main Sep 21, 2024
15 checks passed
@marcphilipp marcphilipp deleted the marc/lock-compatibility-checking branch September 21, 2024 08:58
marcphilipp added a commit that referenced this pull request Sep 21, 2024
This allows tasks with only read locks to be stolen by threads that are
currently holding only read locks.

---------

Co-authored-by: Leonard Brünings <[email protected]>
marcphilipp added a commit that referenced this pull request Sep 23, 2024
This allows tasks with only read locks to be stolen by threads that are
currently holding only read locks.

---------

Co-authored-by: Leonard Brünings <[email protected]>
(cherry picked from commit ebbf134)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants