Our scheduler skipped over threads in about 30% of all cases - that's a bit much; it's
not a penalty to be the first thread in the run queue... I've reduced it to about 12.5%, but that might still be too much. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19710 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8f67ee51b8
commit
4621a82e74
@ -181,7 +181,7 @@ scheduler_reschedule(void)
|
||||
prevThread = NULL;
|
||||
|
||||
if (oldThread->cpu->disabled) {
|
||||
// just select an idle thread
|
||||
// CPU is disabled - just select an idle thread
|
||||
while (nextThread && nextThread->priority > B_IDLE_PRIORITY) {
|
||||
prevThread = nextThread;
|
||||
nextThread = nextThread->queue_next;
|
||||
@ -197,8 +197,8 @@ scheduler_reschedule(void)
|
||||
if (nextThread->queue_next && nextThread->queue_next->priority == B_IDLE_PRIORITY)
|
||||
break;
|
||||
|
||||
// skip normal threads sometimes
|
||||
if (_rand() > 0x3000)
|
||||
// skip normal threads sometimes (roughly 12.5%)
|
||||
if (_rand() > 0x1000)
|
||||
break;
|
||||
|
||||
prevThread = nextThread;
|
||||
|
Loading…
Reference in New Issue
Block a user