From d46c7a5875d788f78e7a61ff1e4a370256b1ff57 Mon Sep 17 00:00:00 2001 From: Sparchatus Date: Thu, 28 Apr 2022 17:30:41 +0000 Subject: [PATCH] URPC server wait defer instead of yield for lower CPU load --- lib/aos/aos_urpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/aos/aos_urpc.c b/lib/aos/aos_urpc.c index fd6979e..256b2af 100644 --- a/lib/aos/aos_urpc.c +++ b/lib/aos/aos_urpc.c @@ -17,6 +17,7 @@ #include #include #include +#include extern coreid_t my_core_id; extern rpc_handler_t rpc_handlers[RPC_MTYPE_COUNT]; @@ -169,8 +170,8 @@ int urpc_server(void *arg) { while (true) { // wait until an rpc call arrives while(urpc->meta->call_in_progress == false) { - // yield the thread because there might be useful stuff to do... - thread_yield(); + // sleep for a bit while there is nothing to do + barrelfish_usleep(100); } // memory barrier