I just completed reading of Windows Vista Kernel – Part 1 by Mark Russinovich. I’m particulary interested in the case of thread scheduling alogoirithm. Once I took a small talk to my colleauges regarding Process, Thread and Synchronization under Windows. When I explained about thread scheduling to them, one question raise in my mind, i.e in normal case, in Windows 2000, a process get 20 ms of time for it’s execution.
When a thread goes to wait state(elapses the CPU time alloted by scheduler), it stores it’s registers, stack and other information (thread context) to continue its exectuion on next turn. So I asked myself, who will allocate clock ticks to save and retrieve this thread context data? The scheduler take it from the alloted time for the thread? Anyway I dint investigate more on that because windows scheduler algorithm is a secret (said not by me, but from Programming Applications for Microsoft Windows – by Jeffrey Richter Please go to the unit “Getting Work done” ). Now When mark explained about the unfair allocation in the older OS, yes my doubt was valid and the real solution comes with Windows Vista. The new Clock Counting Mechanism is really superb with very few overheads. Mark is going to Publish his next Edition of Inside Windows.
Read More About Inside Windows Vista Kernel – Part 1 from Technet