Compare cpu scheduling of linux and windows

Compare cpu scheduling of linux and windows


I mohd sharique ansari of B tech-M Tech (CSE) wish to thank my instructor of numerical analysis Mr. RK Gupta who helped me through the entire development of this paper in best possible way. I would like appreciate the dedication and sincerity of my instructor for his assistance without whom this paper wouldn’t normally been possible.

At last I would like to thank all my close friends for his or her support.



Scheduling basically deals with the selection of a process that is present in the memory and prepared to execute. The selected procedure can be allocated with the CPU. This function is conducted by the CPU scheduler. The CPU scheduler creates a sequence of “moves” that determines the interleaving of threads.

  • Programs use synchronization to avoid “bad moves”.
  • …but otherwise scheduling choices appear (to the program) to be nondeterministic.

The scheduler’s moves happen to be dictated by a scheduling coverage.

A general summary of the scheduling is certainly depicted by the below representation:

Windows process scheduling

1) Windows 3.1 xs used a non-preemptive scheduler, and therefore it did not interrupt programs. It relied on the program to end or notify the OS that it didn’t need processor chip so that it could move on to another process. This is generally called cooperative multitasking. House windows 95 presented a rudimentary preemptive scheduler; even so, for legacy support opted to let 16 little bit applications run without preemption

2) NT-based editions of Windows employ a CPU scheduler predicated on a multilevel responses queue, with 32 priority levels defined. It really is intended to meet up with the following design and style requirements for multimode systems:

  1. Give choice to short jobs.
  2. Give inclination to I/O bound functions.
  3. Quickly establish the type of an activity and schedule the process accordingly.

All processes get a priority raise after a wait event, but processes that contain experienced a key pad I/O wait get a larger boost than those which frederick douglass learning to read have experienced a disk I/O wait.

“Foreground” procedures given higher priority.

3) Windows XP uses a quantum-based, preemptive concern scheduling algorithm. The scheduler was modified in Windows Vista to utilize the routine counter register of modern day processors to keep an eye on exactly how many CPU cycles a thread possesses executed, rather than just using an interval-timer interrupt workout.

Linux Process Scheduling

From versions 2.6 to 2.6.23, the kernel employed an O (1) scheduler. The Completely Fair Scheduler is the name of a task scheduler that was merged in to the 2.6.23 launching of the Linux kernel. It handles CPU source allocation for executing operations, and aims to maximize general CPU utilization while maximizing interactive overall performance. It uses that uses red-black trees rather than queues.

Two classes of functions:

  • real-time (soft deadlines)
  • timesharing algorithm

Normal process scheduling runs on the prioritized, preemptive, credit-based policy:

  • Scheduler always chooses process with credits to run.
  • On each timer interrupt one credit is normally deducted until zero can be reached of which time the procedure is preempted.
  • If no ready procedure afterward all credits for a process calculated as credits = credits/2 + priority.
  • This process favors I/O bound processes which do not use up their credits if they run.

The Circular Robin and FIFO scheduling algorithms are being used to switch between real-time processes

Windows is by significantly the most popular proprietary personal computer operating-system, while Linux is the most prominent free software operating system.




a good)Address space, handle table, statistics and at least one thread

b)Zero inherent parent/child relationship

1) Process is named a Task

a)Standard Address space, handle table, statistics

b)Parent/kid relationship

c)Simple scheduling unit

2) Threads

a) Standard scheduling unit

b) Fibers – cooperative user-mode threads

2) Threads

a)No threads per-se

b)Duties can act like House windows threads by sharing cope with table, PID and address space

c)P-Threads – cooperative user-mode threads


Windows has a kernel-mode Windowing subsystem.


Linux has a user-mode X-Windowing system.

4)Two scheduling classes

a)“Real-time” (fixed) – priority 16-31

b) Dynamic – priority 1-15

4)Comes with 3 scheduling classes

a)Normal – concern 100-139

b)Fixed Round Robin – priority 0-99

c)Fixed FIFO – priority 0-99

5)Higher priorities happen to be favored

a) Priorities of powerful threads receive boosted on wakeups

b)Thread priorities are never lowered

5)Decrease priorities are favored

a) Priorities of regular threads go up (decay) because they use CPU

b)Priorities of interactive threads go down (boost)

6)Most threads operate in adjustable priority levels

a)Priorities 1-15;

b)A newly created thread begins with a bottom priority

c)Threads that finished I/O operations experience priority boosts (but never greater than 15)

d)A thread’s priority won’t be below base priority

6)Most threads make use of a powerful priority policy

a)Normal school – like the classic UNIX scheduler

b)A newly created thread starts how to write synthesis essay with a basic priority

c)Threads that block often (I/O bound) could have their priority gradually increased

d)Threads that constantly exhaust their time slice (CPU bound) will have their priority steadily decreased

7)The House windows API function SetThreadPriority() models the priority benefit for a specified thread

a)This value, alongside the priority school of the thread’s method, determines the thread’s foundation priority level

b)Home windows will dynamically adapt priorities for non-real-time threads

7)“Nice value” pieces a thread’s base priority

a)Larger values = less priority, lower ideals = higher priority

b)Valid pleasant values are in the range of -20 to +20

c)Non-privileged users can only just specify positive nice value

8) Real-time scheduling in windows.

Windows xp facilitates static round-robin scheduling coverage for threads with priorities in real-time range (16-31)

a) Threads work for up to one quantum.

b) Quantum is definitely reset to full turn on preemption.

c) Priorities under no circumstances get boosted.

9) RT threads can starve important system services such as for example CSRSS.EXE

Se-Increase Base Concern Privilege is required to elevate a thread’s concern into real-time range.

8) Real-time scheduling in Linux.

Linux supports two static concern scheduling policies: Round-robin and FIFO (earliest in, first out)

a) Decided on with the sched-setscheduler( ) system call

b) Employ static priority values in the range of 1 1 to 99

c) Executed strictly in order of decreasing static priority

9) RT threads can easily starve lower-priority threads from executing

Root privileges or the CAP-SYS-NICE capability are required for selecting a real-time scheduling policy

10) Some System telephone calls and DPC/APC handling can cause priority inversion

10) Long running system calls can cause priority-inversion

11) Scheduling timeslices in windows

The thread time slice (quantum) is 10ms-120ms

a)When quanta may differ, has one of 2 values

11) Scheduling timeslices in Linux.

The thread quantum is usually 10ms-200ms

a)Default is 100ms

b)Varies across whole range predicated on priority, which is based on interactivity level

12) Windows NT has constantly had an O (1) scheduler based on pre-sorted thread concern queues.

12) The Linux 2.4 scheduler is O(n)

If there are 10 active responsibilities, it scans 10 of them in a list as a way to decide that ought to execute next

This means prolonged scans and long durations under the scheduler lock

13) In home windows (vista sp1) the time-slice varies -manual (consumer setting, window boost) and also automatic (window boost).

13) In Linux 2.6.28 the time-slice will not vary- manual(user setting up, window boost) and computerized (window boost).

14) In house windows (vista sp1) CPU partitioning isn’t possible.

14) In Linux 2.6.28 CPU partitioning (CPU sets) is possible.

15) Scheduler load balancing is not possible.

15) Scheduler load balancing is possible.