Skip to content

Allow for work stealing when only holding read locks - #4012

Merged
marcphilipp merged 19 commits into
mainfrom
marc/lock-compatibility-checking
Sep 21, 2024
Merged

marcphilipp merged 19 commits into
mainfrom
marc/lock-compatibility-checking

Conversation

@marcphilipp

@marcphilipp marcphilipp commented Sep 19, 2024 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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

@leonard84 leonard84 left a comment

Copy link
Copy Markdown
Contributor

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 and others added 4 commits September 20, 2024 12:05
…rite lock

Co-authored-by: Leonard Brünings <leonard.bruenings@gradle.com>
Co-authored-by: Leonard Brünings <leonard.bruenings@gradle.com>
@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
@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 <leonard.bruenings@gradle.com>
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 <leonard.bruenings@gradle.com>
(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