summaryrefslogtreecommitdiffstats
path: root/benches/sync_semaphore.rs
diff options
context:
space:
mode:
authorLucio Franco <luciofranco14@gmail.com>2020-10-12 13:44:54 -0400
committerGitHub <noreply@github.com>2020-10-12 13:44:54 -0400
commit8880222036f37c6204c8466f25e828447f16dacb (patch)
treefd623afc20f73bbce65746a3d1b1b2731ecf30a5 /benches/sync_semaphore.rs
parent0893841f31542b2b04c5050a8a4a3c45cf867e55 (diff)
rt: Remove `threaded_scheduler()` and `basic_scheduler()` (#2876)
Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Carl Lerche <me@carllerche.com>
Diffstat (limited to 'benches/sync_semaphore.rs')
-rw-r--r--benches/sync_semaphore.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/benches/sync_semaphore.rs b/benches/sync_semaphore.rs
index 32d4aa2b..19a1dd33 100644
--- a/benches/sync_semaphore.rs
+++ b/benches/sync_semaphore.rs
@@ -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)
.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();