Skip to content

Introduce a separate slot for stealing tasks into in CoroutineScheduler #3537

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

Merged
merged 9 commits into from
Jan 16, 2023

Conversation

qwwdfsad
Copy link
Member

It solves two problems:

  • Stealing into exclusively owned local queue does no longer require and CAS'es or atomic operations where they were previously not needed. It should save a few cycles on the stealing code path
  • The overall timing perturbations should be slightly better now: previously it was possible for the stolen task to be immediately got stolen again from the stealer thread because it was actually published to owner's queue, but its submission time was never updated

Fixes #3416

It solves two problems:

* Stealing into exclusively owned local queue does no longer require and CAS'es or atomic operations where they were previously not needed. It should save a few cycles on the stealing code path
* The overall timing perturbations should be slightly better now: previously it was possible for the stolen task to be immediately got stolen again from the stealer thread because it was actually published to owner's queue, but its submission time was never updated

Fixes #3416
@qwwdfsad qwwdfsad force-pushed the scheduler-improvement branch from ed9c9d9 to 20daaa7 Compare November 22, 2022 10:46
@qwwdfsad qwwdfsad force-pushed the scheduler-improvement branch from abd2209 to 54f5766 Compare November 22, 2022 14:37
@qwwdfsad
Copy link
Member Author

The last commit is the fix for #3418, it was more convenient to do it right in the same branch

@qwwdfsad qwwdfsad force-pushed the scheduler-improvement branch from 865d0bf to 6d97bf5 Compare November 22, 2022 16:55
Previously, a worker thread unconditionally processed tasks from its own local queue, even if tasks were CPU-intensive, but CPU token was not acquired.

Fixes #3418
@qwwdfsad qwwdfsad force-pushed the scheduler-improvement branch from 6d97bf5 to ca035a0 Compare November 22, 2022 16:56
Previously, a worker thread unconditionally processed tasks from its own local queue, even if tasks were CPU-intensive, but CPU token was not acquired.

Fixes #3418
@qwwdfsad qwwdfsad requested a review from dkhalanskyjb January 3, 2023 11:12
@qwwdfsad qwwdfsad merged commit 87d1af9 into develop Jan 16, 2023
@qwwdfsad qwwdfsad deleted the scheduler-improvement branch January 16, 2023 16:08
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