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

Make @threads :dynamic default #44136

Merged

Conversation

IanButterworth
Copy link
Member

Follow-up to #43919

Makes the new :dynamic schedule for Threads.@threads the default.

@IanButterworth IanButterworth requested a review from tkf February 12, 2022 03:32
NEWS.md Outdated Show resolved Hide resolved
@tkf
Copy link
Member

tkf commented Feb 12, 2022

Just for future search-ability, this PR is a conclusion of the feature seeded in #35646 and implemented in #43919. PR #43919 introduced :dynamic scheduling and triage has already decided that it's a good fit for the default scheduler option of @threads for (#43919 (comment)).

The change in the code is minimal. So, I think it can be merged once CI is sufficiently happy.

@DilumAluthge DilumAluthge merged commit 976dcc8 into JuliaLang:master Feb 13, 2022
@IanButterworth IanButterworth deleted the ib/threads_dynamic_default branch February 13, 2022 06:46
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Feb 13, 2022
Schedule options are:
- `:static` creates one task per thread and divides the iterations equally among
them, assigning each task specifically to each thread.
Specifying `:static` is an error if used from inside another `@threads` loop
or from a thread other than 1.
- `:dynamic` will schedule iterations dynamically to available worker threads,
- `:dynamic` (default) will schedule iterations dynamically to available worker threads,
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps the default should be listed first

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense #44163

@tkf tkf added the multithreading Base.Threads and related functionality label Feb 14, 2022
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request Feb 17, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
jakobnissen added a commit to jakobnissen/julia that referenced this pull request Aug 28, 2022
The docs on multithreading still warns that the default scheduler for @threads
uses static scheduling. However, since JuliaLang#44136, dynamic scheduling has been the
default. This commit removes the warning.
KristofferC pushed a commit that referenced this pull request Aug 29, 2022
The docs on multithreading still warns that the default scheduler for @threads
uses static scheduling. However, since #44136, dynamic scheduling has been the
default. This commit removes the warning.
KristofferC pushed a commit that referenced this pull request Aug 30, 2022
The docs on multithreading still warns that the default scheduler for @threads
uses static scheduling. However, since #44136, dynamic scheduling has been the
default. This commit removes the warning.

(cherry picked from commit 72222d6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants