Scheduling basically deals with the selection of a process that exists in the memory and ready to execute. The selected process is allocated with the CPU. This function is performed by the CPU scheduler. The CPU scheduler makes a sequence of "moves" that determines the interleaving of threads.
- Programs use synchronization to prevent "bad moves".
- but otherwise scheduling choices appear (to the program) to be nondeterministic.
The scheduler's moves are dictated by a scheduling policy.
Windows process scheduling
1) Windows 3.1 xs used a non-preemptive scheduler, meaning that it did not interrupt programs. It relied on the program to end or tell the OS that it didn't need processor so that it could move on to another process. This is usually called cooperative multitasking. Windows 95 introduced a rudimentary preemptive scheduler; however, for legacy support opted to let 16 bit applications run without preemption
Get your grade
or your money back
using our Essay Writing Service!
2) NT-based versions of Windows use a CPU scheduler based on a multilevel feedback queue, with 32 priority levels defined. It is intended to meet the following design requirements for multimode systems:
- Give preference to short jobs.
- Give preference to I/O bound processes.
- Quickly establish the nature of a process and schedule the process accordingly.
All processes receive a priority boost after a wait event, but processes that have experienced a keyboard I/O wait get a larger boost than those that have experienced a disk I/O wait.
"Foreground" processes given higher priority.
3) Windows XP uses a quantum-based, preemptive priority scheduling algorithm. The scheduler was modified in Windows Vista to use the cycle counter register of modern processors to keep track of exactly how many CPU cycles a thread has executed, rather than just using an interval-timer interrupt routine.
Linux Process Scheduling
From versions 2.6 to 2.6.23, the kernel used an O (1) scheduler. The Completely Fair Scheduler is the name of a task scheduler which was merged into the 2.6.23 release of the Linux kernel. It handles CPU resource allocation for executing processes, and aims to maximize overall CPU utilization while maximizing interactive performance. It uses that uses red-black trees instead of queues.
Two classes of processes:
- real-time (soft deadlines)
- timesharing algorithm
Normal process scheduling uses a prioritized, preemptive, credit-based policy:
- Scheduler always chooses process with the most credits to run.
- On each timer interrupt one credit is deducted until zero is reached at which time the process is preempted.
- If no ready process then all credits for a process calculated as credits = credits/2 + priority.
- This approach favors I/O bound processes which do not use up their credits when they run.
The Round Robin and FIFO scheduling algorithms are used to switch between real-time processes
Windows is by far the most popular proprietary personal computer operating system, while Linux is the most prominent free software operating system.