From 7e46f8319eb42452fc0fdf636dd23861674ed0c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 31 Jan 2006 00:11:51 +0000 Subject: [PATCH] snooze(5) works more or less fine for standard threads, but is a very bad idea for real-time threads. They could completely hog the CPU in this case. Thanks to Marcus for investigating! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16161 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/malloc/arch-specific.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/libroot/posix/malloc/arch-specific.cpp b/src/system/libroot/posix/malloc/arch-specific.cpp index c03ac403f9..ef780e594f 100644 --- a/src/system/libroot/posix/malloc/arch-specific.cpp +++ b/src/system/libroot/posix/malloc/arch-specific.cpp @@ -317,10 +317,10 @@ hoardUnlock(hoardLockType &lock) void hoardYield(void) { - // A thread's quantum is definitely larger than this, so this is - // an expensive yield function. + // We need to snooze longer than a thread quantum (3ms) to ensure + // real-time threads won't hog the CPU completely // ToDo: we should have a real one in the kernel - snooze(5); + snooze(4000); } } // namespace BPrivate