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
rt: Remove threaded_scheduler()
and basic_scheduler()
#2876
Merged
Merged
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
f3b8d88
rt: Remove `threaded_scheduler()` and `basic_scheduler()`
LucioFranco 692b418
Fix docs
LucioFranco 1db81a9
Rewrite tokio-macros to new argument format
Darksonn 1ecd3bc
Update tests
Darksonn ccd426d
Rename to current_thread/threaded and remove max_threads
Darksonn 019945f
Use match in build
Darksonn 8c2b54a
Fix tests
Darksonn a1ae97c
rustfmt
Darksonn 430993d
clippy
Darksonn 10a2735
Try to fix doctests
Darksonn 0775bd4
test_fail as main -> test
Darksonn 9c22b85
Add `new_multi_thread`/`new_current_thread`/`new_single_thread`
LucioFranco 45c4977
Add runtime builders
LucioFranco 2178252
remove shell runtime
LucioFranco 97717ac
Remove shell runtime test
Darksonn 0a8c401
more feature flag mess
LucioFranco 1f747ca
Merge remote-tracking branch 'origin/master' into lucio/refactor-runt…
carllerche 5c9e72d
fix feature flags
carllerche 53f28e2
remove stray blocking cfgs
carllerche 456af82
fix tests
carllerche fabd58e
fix feature combo
carllerche 559cf99
fix windows
carllerche 8b78067
fix build
carllerche b982350
fix docs
carllerche 112cf71
fix docs hopefully
carllerche f9a22e6
fix loom build
carllerche 3270ce5
fix tokio-util
carllerche 3b1eb17
Merge remote-tracking branch 'origin/macro-new-builder' into lucio/re…
carllerche 61421e7
fix macro doc examples
carllerche 130beed
fix bad type
carllerche 2c9acd1
Update tokio/src/io/driver/mod.rs
carllerche bc77b12
tests + rename num_workers
carllerche 55ba939
Merge branch 'lucio/refactor-runtime-builder' of https://github.com/t…
carllerche 9003409
tweak ff
carllerche f8bb6a0
fix a test
carllerche f10eedf
fix doc links
carllerche 5c5f205
try to fix CI
carllerche fb155dd
tweak multi-threaded flavor
carllerche 5a94b7e
fix doc test
carllerche 22f5237
update error message
carllerche e3f2f86
Apply suggestions from code review
LucioFranco 3ad8f3b
address comments
LucioFranco 5829241
Merge branch 'master' of github.com:tokio-rs/tokio into lucio/refacto…
LucioFranco File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 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 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 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 |
---|---|---|
|
@@ -3,9 +3,8 @@ use std::sync::Arc; | |
use tokio::{sync::Semaphore, task}; | ||
|
||
fn uncontended(b: &mut Bencher) { | ||
let rt = tokio::runtime::Builder::new() | ||
.core_threads(6) | ||
.threaded_scheduler() | ||
let rt = tokio::runtime::Builder::new_multi_thread() | ||
.worker_threads(6) | ||
.build() | ||
.unwrap(); | ||
|
||
|
@@ -27,9 +26,8 @@ async fn task(s: Arc<Semaphore>) { | |
} | ||
|
||
fn uncontended_concurrent_multi(b: &mut Bencher) { | ||
let rt = tokio::runtime::Builder::new() | ||
.core_threads(6) | ||
.threaded_scheduler() | ||
let rt = tokio::runtime::Builder::new_multi_thread() | ||
.worker_threads(6) | ||
.build() | ||
.unwrap(); | ||
|
||
|
@@ -51,8 +49,8 @@ fn uncontended_concurrent_multi(b: &mut Bencher) { | |
} | ||
|
||
fn uncontended_concurrent_single(b: &mut Bencher) { | ||
let rt = tokio::runtime::Builder::new() | ||
.basic_scheduler() | ||
let rt = tokio::runtime::Builder::new_multi_thread() | ||
.worker_threads(0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here is this valid? |
||
.build() | ||
.unwrap(); | ||
|
||
|
@@ -73,9 +71,8 @@ fn uncontended_concurrent_single(b: &mut Bencher) { | |
} | ||
|
||
fn contended_concurrent_multi(b: &mut Bencher) { | ||
let rt = tokio::runtime::Builder::new() | ||
.core_threads(6) | ||
.threaded_scheduler() | ||
let rt = tokio::runtime::Builder::new_multi_thread() | ||
.worker_threads(6) | ||
.build() | ||
.unwrap(); | ||
|
||
|
@@ -97,8 +94,7 @@ fn contended_concurrent_multi(b: &mut Bencher) { | |
} | ||
|
||
fn contended_concurrent_single(b: &mut Bencher) { | ||
let rt = tokio::runtime::Builder::new() | ||
.basic_scheduler() | ||
let rt = tokio::runtime::Builder::new_current_thread() | ||
.build() | ||
.unwrap(); | ||
|
||
|
This file contains 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 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,6 @@ | ||
use tests_build::tokio; | ||
|
||
#[tokio::main] | ||
async fn my_fn() {} | ||
|
||
fn main() {} |
This file contains 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,7 @@ | ||
error: The default runtime flavor is `multi_thread`, but the `rt-threaded` feature is disabled. | ||
--> $DIR/macros_core_no_default.rs:3:1 | ||
| | ||
3 | #[tokio::main] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains 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 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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
#[test] | ||
fn compile_fail() { | ||
fn compile_fail_full() { | ||
let t = trybuild::TestCases::new(); | ||
|
||
#[cfg(feature = "full")] | ||
t.compile_fail("tests/fail/macros_invalid_input.rs"); | ||
|
||
#[cfg(all(feature = "rt-core", not(feature = "full")))] | ||
t.compile_fail("tests/fail/macros_core_no_default.rs"); | ||
|
||
drop(t); | ||
} |
This file contains 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This to me doesn't make sense, why 0? I would imagine we should not allow that unless the multi thread runtime can be a current thread one?