scheduler: Increase thread penalty at fork
This commit is contained in:
parent
a2634874ed
commit
082d3c1015
@ -106,10 +106,16 @@ ThreadData::Init()
|
||||
{
|
||||
_InitBase();
|
||||
|
||||
ThreadData* currentThreadData = thread_get_current_thread()->scheduler_data;
|
||||
Thread* currentThread = thread_get_current_thread();
|
||||
ThreadData* currentThreadData = currentThread->scheduler_data;
|
||||
fCore = currentThreadData->fCore;
|
||||
|
||||
if (fThread->priority < B_FIRST_REAL_TIME_PRIORITY) {
|
||||
if (!thread_is_idle_thread(currentThread)
|
||||
&& currentThread->priority < B_FIRST_REAL_TIME_PRIORITY) {
|
||||
currentThreadData->_IncreasePenalty(false);
|
||||
}
|
||||
|
||||
fPriorityPenalty = std::min(currentThreadData->fPriorityPenalty,
|
||||
std::max(fThread->priority - _GetMinimalPriority(), int32(0)));
|
||||
fAdditionalPenalty = currentThreadData->fAdditionalPenalty;
|
||||
|
@ -426,8 +426,7 @@ ThreadData::HasQuantumEnded(bool wasPreempted, bool hasYielded)
|
||||
fTimeLeft -= timeUsed;
|
||||
|
||||
// too little time left, it's better make the next quantum a bit longer
|
||||
int32 skipTime = gCurrentMode->minimal_quantum;
|
||||
skipTime -= skipTime / 10;
|
||||
int32 skipTime = gCurrentMode->minimal_quantum / 2;
|
||||
if (wasPreempted || fTimeLeft <= skipTime) {
|
||||
fStolenTime += fTimeLeft;
|
||||
fTimeLeft = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user