Implement thread preemption and context switching in dispatch interrupt handler

This commit is contained in:
2026-06-18 11:18:36 +02:00
parent 156ae3efab
commit bae43034a6
3 changed files with 96 additions and 2 deletions

View File

@@ -36,6 +36,20 @@ KE::Scheduler::InsertDeferredReadyList(IN PKTHREAD Thread)
RTL::LifoQueue::PushEntryList(&Prcb->DeferredReadyListHead, &Thread->SwapListEntry);
}
/**
* Handles the expiration of the currently executing thread's time quantum.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
KE::Scheduler::ProcessQuantumEnd(VOID)
{
UNIMPLEMENTED;
}
/**
* Transitions a thread to the ready state and queues it for execution within the dispatcher database.
*
@@ -74,6 +88,27 @@ KE::Scheduler::ProcessReadyThread(IN PKTHREAD Thread)
}
}
/**
* Enqueues a thread into the target processor's execution queue.
*
* @param Thread
* Supplies a pointer to the thread that is ready for execution.
*
* @param Prcb
* Supplies a pointer to the Processor Control Block of the target core.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTFASTCALL
VOID
KE::Scheduler::QueueReadyThread(IN PKTHREAD Thread,
IN PKPROCESSOR_CONTROL_BLOCK Prcb)
{
UNIMPLEMENTED;
}
/**
* Prepares a thread for execution by safely acquiring the dispatcher database lock.
*