From 8642c075ea5c309ddd9cb888ceb3ac0751440ef7 Mon Sep 17 00:00:00 2001 From: Sparchatus Date: Mon, 9 May 2022 07:42:27 +0000 Subject: [PATCH] Realized yielding is actually faster by a lot --- lib/aos/aos_urpc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/aos/aos_urpc.c b/lib/aos/aos_urpc.c index 71738a6..011e48b 100644 --- a/lib/aos/aos_urpc.c +++ b/lib/aos/aos_urpc.c @@ -56,7 +56,7 @@ errval_t do_aos_urpc( // wait until the rpc call completes while(rpc->meta->call_in_progress) { // yield the thread because there might be useful stuff to do... - // thread_yield(); + thread_yield(); } // memory barrier @@ -180,9 +180,8 @@ int urpc_server(void *arg) { while (true) { // wait until an rpc call arrives while(urpc->meta->call_in_progress == false) { - // sleep for a bit while there is nothing to do - // barrelfish_usleep(100); - // thread_yield(); + // yield the thread because there might be useful stuff to do... + thread_yield(); } // memory barrier