mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 10:26:59 +00:00
perf(userland): replace sys_yield with sleep for WAY better idle efficiency
This commit is contained in:
@@ -158,7 +158,7 @@ static int _b_pipe_read(fd_handle_t *h, void *buf, size_t count) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
sys_yield();
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ static int _b_pipe_write(fd_handle_t *h, const void *buf, size_t count) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
sys_yield();
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "errno.h"
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include "sys/types.h"
|
||||
#include "sys/wait.h"
|
||||
@@ -219,6 +220,6 @@ __attribute__((weak)) pid_t waitpid(pid_t pid, int *status, int options) {
|
||||
errno = ECHILD;
|
||||
return -1;
|
||||
}
|
||||
sys_yield();
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user