From 41cb7c96110a330bf4457544962dc8b6251b5955 Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Sat, 2 Nov 2024 15:14:00 +0900 Subject: [PATCH] Remove yield_now --- sorock/src/process/thread/advance_kern.rs | 1 - sorock/src/process/thread/advance_user.rs | 1 - sorock/src/process/thread/query_execution.rs | 4 +--- sorock/src/process/thread/replication.rs | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sorock/src/process/thread/advance_kern.rs b/sorock/src/process/thread/advance_kern.rs index bb307000..47a30009 100644 --- a/sorock/src/process/thread/advance_kern.rs +++ b/sorock/src/process/thread/advance_kern.rs @@ -20,7 +20,6 @@ impl Thread { self.consumer.consume_events(Duration::from_secs(1)).await; while self.advance_once().await.is_ok() { self.producer.push_event(KernEvent); - tokio::task::yield_now().await; } } }; diff --git a/sorock/src/process/thread/advance_user.rs b/sorock/src/process/thread/advance_user.rs index 6b867e11..4c7f525f 100644 --- a/sorock/src/process/thread/advance_user.rs +++ b/sorock/src/process/thread/advance_user.rs @@ -21,7 +21,6 @@ impl Thread { self.consumer.consume_events(Duration::from_secs(1)).await; while self.advance_once().await.is_ok() { self.producer.push_event(ApplicationEvent); - tokio::task::yield_now().await; } } }; diff --git a/sorock/src/process/thread/query_execution.rs b/sorock/src/process/thread/query_execution.rs index 08ba8d88..e949c5d6 100644 --- a/sorock/src/process/thread/query_execution.rs +++ b/sorock/src/process/thread/query_execution.rs @@ -19,9 +19,7 @@ impl Thread { self.consumer .consume_events(Duration::from_millis(100)) .await; - while self.advance_once().await { - tokio::task::yield_now().await; - } + while self.advance_once().await {} } }; let hdl = tokio::spawn(fut).abort_handle(); diff --git a/sorock/src/process/thread/replication.rs b/sorock/src/process/thread/replication.rs index bedb1eda..bba7ff80 100644 --- a/sorock/src/process/thread/replication.rs +++ b/sorock/src/process/thread/replication.rs @@ -28,7 +28,6 @@ impl Thread { self.consumer.consume_events(Duration::from_secs(1)).await; while let Ok(true) = self.advance_once().await { self.producer.push_event(ReplicationEvent); - tokio::task::yield_now().await; } } };