Added a real yield function to the kernel (using the next_priority approach).
The test application lets run a thread at the highest priority that calls yield all the time - the system stays responsible when it runs, so it seems to work fine :) Changed the malloc implementation to use _kern_thread_yield() instead of snoozing. We should think about making this call public, too. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16166 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -317,10 +317,7 @@ hoardUnlock(hoardLockType &lock)
|
||||
void
|
||||
hoardYield(void)
|
||||
{
|
||||
// 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(4000);
|
||||
_kern_thread_yield();
|
||||
}
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
Reference in New Issue
Block a user