mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-05 20:39:16 +00:00
Simple CPU affinity system
This commit is contained in:
@ -140,6 +140,9 @@ namespace Tasking
|
||||
if (tcb->Status != TaskStatus::Ready)
|
||||
continue;
|
||||
|
||||
if (tcb->Info.Affinity[CurrentCPU->ID] == false)
|
||||
continue;
|
||||
|
||||
CurrentCPU->CurrentProcess = pcb;
|
||||
CurrentCPU->CurrentThread = tcb;
|
||||
return true;
|
||||
@ -178,6 +181,9 @@ namespace Tasking
|
||||
goto RetryAnotherThread;
|
||||
}
|
||||
|
||||
if (thread->Info.Affinity[CurrentCPU->ID] == false)
|
||||
continue;
|
||||
|
||||
CurrentCPU->CurrentThread = thread;
|
||||
gnat_schedbg("[thd 0 -> end] Scheduling thread %d parent of %s->%d Procs %d", thread->ID, thread->Parent->Name, CurrentCPU->CurrentProcess->Threads.size(), ListProcess.size());
|
||||
return true;
|
||||
@ -238,6 +244,9 @@ namespace Tasking
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tcb->Info.Affinity[CurrentCPU->ID] == false)
|
||||
continue;
|
||||
|
||||
CurrentCPU->CurrentProcess = pcb;
|
||||
CurrentCPU->CurrentThread = tcb;
|
||||
gnap_schedbg("[cur proc+1 -> first thd] Scheduling thread %d %s->%d (Total Procs %d)", tcb->ID, tcb->Name, pcb->Threads.size(), ListProcess.size());
|
||||
@ -290,6 +299,9 @@ namespace Tasking
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tcb->Info.Affinity[CurrentCPU->ID] == false)
|
||||
continue;
|
||||
|
||||
CurrentCPU->CurrentProcess = pcb;
|
||||
CurrentCPU->CurrentThread = tcb;
|
||||
sspt_schedbg("[proc 0 -> end -> first thd] Scheduling thread %d parent of %s->%d (Procs %d)", tcb->ID, tcb->Parent->Name, pcb->Threads.size(), ListProcess.size());
|
||||
|
Reference in New Issue
Block a user