diff options
author | Marvin Borner | 2020-09-07 00:17:04 +0200 |
---|---|---|
committer | Marvin Borner | 2020-09-07 00:17:04 +0200 |
commit | 9c2f40441e0cc909ebefe432ddc10e2de29b82ac (patch) | |
tree | 2dcdd4ae56faab40f4bbbee27e72023e3b8acdbb /apps | |
parent | 97f57cf4da45d268bbea863ae7bf40bb8c749aad (diff) |
Added wait syscall.
This makes a process sleep until it receives a new message (no polling!).
I thought that this will result in performance improvements but I haven't
noticed any, yet. Maybe I'll remove this again in the future..
Diffstat (limited to 'apps')
-rw-r--r-- | apps/init.c | 3 | ||||
-rw-r--r-- | apps/mandelbrot.c | 3 | ||||
-rw-r--r-- | apps/wm.c | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/apps/init.c b/apps/init.c index ba6f93e..ccf88dd 100644 --- a/apps/init.c +++ b/apps/init.c @@ -13,5 +13,8 @@ int main(int argc, char **argv) /* int test = exec("/window", "test", NULL); */ int mandelbrot = exec("/mandelbrot", "mandelbrot", NULL); + while (1) { + yield(); + }; return wm + mandelbrot; } diff --git a/apps/mandelbrot.c b/apps/mandelbrot.c index d5b8ae0..9f73501 100644 --- a/apps/mandelbrot.c +++ b/apps/mandelbrot.c @@ -49,7 +49,6 @@ void draw_mandelbrot(struct window *win, int resolution) } gui_redraw(); print("Rendered mandelbrot successfully\n"); - yield(); } int main() @@ -62,7 +61,7 @@ int main() draw_mandelbrot(win, 50); while (1) { - yield(); + wait(); }; return 0; @@ -12,7 +12,7 @@ #include <sys.h> #include <vesa.h> -#define MOUSE_SKIP 4 // => Every nth move gets skipped +#define MOUSE_SKIP 5 // => Every move % n != 0 gets skipped static struct vbe *vbe; static struct window *direct; // Direct video memory window @@ -84,7 +84,7 @@ int main(int argc, char **argv) int mouse_skip = 0; while (1) { if (!(msg = msg_receive())) { - yield(); + wait(); continue; } |