NeKernel's RT Scheduler Subsystem Balancing
Why?
Some processes need more time than other over time, and balancing these will make the system faster overall.
How?
You adjust the process PTime (ProcessTime) using the RTime (RunTime) variable, this must update the affinity too.
Where?
Hosted on NeKernel's GitHub Organization
Code Snippet (Taken from dev)
if (UserProcessHelper::CanBeScheduled(process)) {
kout << process.Name << " will be scheduled...\r";
this->TheCurrentProcess() = process;
if (UserProcessHelper::Switch(process.StackFrame, process.ProcessId)) {
process.PTime = static_cast<Int32>(process.Affinity);
if (process.PTime < process.RTime && AffinityKind::kRealTime = process.Affinity) {
if (process.RTime < (Int32) AffinityKind::kVeryHigh)
process.RTime= (Int32) AffinityKind::kLowUsage / 2;
else if (process.RTime < (Int32) AffinityKind::kHigh)
process.RTime= (Int32) AffinityKind::kStandard / 3;
else if (process.RTime < (Int32) AffinityKind::kStandard)
process.RTime= (Int32) AffinityKind::kHigh / 4;
process.PTime -= process.RTime;
process.RTime= 0UL;
}
}
} else {
++process.RTime;
--process.PTime;
}