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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user