Skip to content
Snippets Groups Projects
Commit 4f725d4f authored by Avi Kivity's avatar Avi Kivity
Browse files

sched: add idle thread

Previously, we performed idle processing in the scheduler, in the context
of the thread that is being scheudled out.  This makes preemption more
complicated, since every thread can potentially be in the idle loop
simultaneously, having been preempted there some time in the past.  Obviously
we can't disable interrupts in the idle loop.

Move idle processing to its own thread to fix this problem.  This is currently
sub-optimal since we don't have priority classes yet (or even just priorities),
so the idle thread can be scheduled before workload threads.  If that happens
it will examine the runqueue and yield if there's anything there.
parent b729fff6
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment