Mostly you want to avoid hardware task switching because it doesn't work well with multicore CPUs, as the switching process is modifying descriptor types. Another problem is that you will often double save registers when using hardware task switching, which is caused by a badly designed interface where you must both load and save task state in one step. A typical software task switcher will first save the registers of the incoming task, select a new task, and then load a new task.Combuster wrote:It's exactly the opposite: you do not want hardware task switching for reasons of simplicity.ManyGifts wrote:Yes, I would like to use hardware task switching as it's my first kernel.
Task scheduler infinite loop
Re: Task scheduler infinite loop
-
- Member
- Posts: 510
- Joined: Wed Mar 09, 2011 3:55 am
Re: Task scheduler infinite loop
In other words, it's when you're very busy doing nothing while you wait for something to do.bwat wrote:I don't think you've fully understood the terms you've used.
No. Switching tasks has nothing to do with avoiding busy waiting.thomasloven wrote:Switching tasks when a process blocks helps in order to avoid bussy waiting
Busy waiting is when you continuously poll for a change in state.
If the process blocks then it performs no work. The process cannot by definition be busy when blocked.
On a well designed system where the OS keeps a list of blocked processes that it then does not schedule to run, yes. On a crappily designed system where there's no such thing as blocking at the OS level, the process has to implement it itself, and the best it can do is busy waiting. In that case the process is both busy and blocked (or as close to blocked as you can get on such a system).