-
Notifications
You must be signed in to change notification settings - Fork 340
EMA based statistically adaptive thread pool design #108
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
Closed
vertexclique
wants to merge
20
commits into
async-rs:master
from
vertexclique:ema-based-statistically-adaptive-thread-pool
Closed
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0e6b30f
EMA based statistically adaptive blocking thread pool
vertexclique 4a1afcd
Make cargo fmt happy
vertexclique 7f237b7
Use saturating_sub as a guard against low watermark
vertexclique 55664f1
Make frequency calculation more clear
vertexclique ecfce3a
Use guaranteed delta history for changes in current pool size
vertexclique 1de75ee
Use longer spanning saturated joins during scale down
vertexclique 07eac68
r/w ordering guarantees for atomics
vertexclique 08c8e04
Use thread adaptation mechanism
vertexclique 2dca64d
Documentation for thread scale
vertexclique d9785cc
Ignore concurrency tests
vertexclique 9135ca0
Pool manager thread documentation
vertexclique 4606893
Move to the exponential scaling algorithm
vertexclique 73ccc67
Solve pool max threads problem for MacOS
vertexclique 186d55f
Typos and table formatting
vertexclique e765cee
Doc comments for the module
vertexclique 2340250
Make no format block text
vertexclique 572b80f
Refactor doc comments
vertexclique 6664f4b
Removal of Arc
vertexclique e934a5e
Safe arithmetic ops
vertexclique 405b081
Threshold fixes for congestion case
vertexclique File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#![feature(test)] | ||
|
||
extern crate test; | ||
|
||
use async_std::task; | ||
use async_std::task::blocking::JoinHandle; | ||
use futures::future::join_all; | ||
use std::thread; | ||
use std::time::Duration; | ||
use test::Bencher; | ||
|
||
#[bench] | ||
fn blocking(b: &mut Bencher) { | ||
b.iter(|| { | ||
let handles = (0..10_000) | ||
.map(|_| { | ||
task::blocking::spawn(async { | ||
let duration = Duration::from_millis(1); | ||
thread::sleep(duration); | ||
}) | ||
}) | ||
.collect::<Vec<JoinHandle<()>>>(); | ||
|
||
task::block_on(join_all(handles)); | ||
}); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,4 @@ mod pool; | |
mod sleep; | ||
mod task; | ||
|
||
pub(crate) mod blocking; | ||
pub mod blocking; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.