Compare cpu scheduling of linux and windows

ACKNOWLEGMENT
I mohd sharique ansari of B tech-M Tech (CSE) would like to thank my teacher of numerical analysis Mr. RK Gupta who helped me throughout the development of this paper in best possible way. I would like appreciate the dedication and sincerity of my teacher for his guidance without whom this paper would not been possible.
At last I would like to thank all my friends for their support.
INTRODUCTION
CPU SCHEDULING:
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.

Don't use plagiarized sources. Get Your Custom Essay on
Compare cpu scheduling of linux and windows
Just from $13/Page
Order Essay

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.
A general overview of the scheduling is depicted by the below representation:
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
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.

Windows

Linux

1)Process
a)Address space, handle table, statistics and at least one thread
b)No inherent parent/child relationship

1) Process is called a Task
a)Basic Address space, handle table, statistics
b)Parent/child relationship
c)Basic scheduling unit

2) Threads
a) Basic scheduling unit
b) Fibers – cooperative user-mode threads

2) Threads
a)No threads per-se
b)Tasks can act like Windows threads by sharing handle table, PID and address space
c)P-Threads – cooperative user-mode threads

3)windowing
Windows has a kernel-mode Windowing subsystem.

3)windowing
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)Has 3 scheduling classes
a)Normal – priority 100-139
b)Fixed Round Robin – priority 0-99
c)Fixed FIFO – priority 0-99

5)Higher priorities are favored
a) Priorities of dynamic threads get boosted on wakeups
b)Thread priorities are never lowered
 

5)Lower priorities are favored
a) Priorities of normal threads go up (decay) as they use CPU
b)Priorities of interactive threads go down (boost)
 

6)Most threads run in variable priority levels
a)Priorities 1-15;
b)A newly created thread starts with a base priority
c)Threads that complete I/O operations experience priority boosts (but never higher than 15)
d)A thread’s priority will never be below base priority

6)Most threads use a dynamic priority policy
a)Normal class – similar to the classic UNIX scheduler
b)A newly created thread starts with a base priority
c)Threads that block frequently (I/O bound) will have their priority gradually increased
d)Threads that always exhaust their time slice (CPU bound) will have their priority gradually decreased

7)The Windows API function SetThreadPriority() sets the priority value for a specified thread
a)This value, together with the priority class of the thread’s process, determines the thread’s base priority level
b)Windows will dynamically adjust priorities for non-real-time threads

7)“Nice value” sets a thread’s base priority
a)Larger values = less priority, lower values = higher priority
b)Valid nice values are in the range of -20 to +20
c)Non-privileged users can only specify positive nice value

8) Real time scheduling in windows.
Windows xp supports static round-robin scheduling policy for threads with priorities in real-time range (16-31)
a) Threads run for up to one quantum.
b) Quantum is reset to full turn on preemption.
c) Priorities never get boosted.
9) RT threads can starve important system services such as CSRSS.EXE
Se-Increase Base Priority Privilege is required to elevate a thread’s priority into real-time range.

8) Real time scheduling in Linux.
Linux supports two static priority scheduling policies: Round-robin and FIFO (first in, first out)
a) Selected with the sched-setscheduler( ) system call
b) Use static priority values in the range of 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 the selection of a real-time scheduling policy

10) Some System 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 can vary, has one of 2 values

11) Scheduling timeslices in Linux.
The thread quantum is 10ms-200ms
a)Default is 100ms
b)Varies across entire range based on priority, which is based on interactivity level

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

12) The Linux 2.4 scheduler is O(n)
If there are 10 active tasks, it scans 10 of them in a list in order to decide which should execute next
This means long scans and long durations under the scheduler lock

13) In windows (vista sp1) the time-slice varies -manual (user setting, window boost) as well as automatic (window boost).

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

14) In windows (vista sp1) CPU partitioning is not 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.

 

What Will You Get?

We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.

Premium Quality

Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.

Experienced Writers

Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.

On-Time Delivery

Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.

24/7 Customer Support

Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.

Complete Confidentiality

Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.

Authentic Sources

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.

Moneyback Guarantee

Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.

Order Tracking

You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.

image

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

image

Trusted Partner of 9650+ Students for Writing

From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.

Preferred Writer

Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.

Grammar Check Report

Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.

One Page Summary

You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.

Plagiarism Report

You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.

Free Features $66FREE

  • Most Qualified Writer $10FREE
  • Plagiarism Scan Report $10FREE
  • Unlimited Revisions $08FREE
  • Paper Formatting $05FREE
  • Cover Page $05FREE
  • Referencing & Bibliography $10FREE
  • Dedicated User Area $08FREE
  • 24/7 Order Tracking $05FREE
  • Periodic Email Alerts $05FREE
image

Our Services

Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.

  • On-time Delivery
  • 24/7 Order Tracking
  • Access to Authentic Sources
Academic Writing

We create perfect papers according to the guidelines.

Professional Editing

We seamlessly edit out errors from your papers.

Thorough Proofreading

We thoroughly read your final draft to identify errors.

image

Delegate Your Challenging Writing Tasks to Experienced Professionals

Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!

Check Out Our Sample Work

Dedication. Quality. Commitment. Punctuality

Categories
All samples
Essay (any type)
Essay (any type)
The Value of a Nursing Degree
Undergrad. (yrs 3-4)
Nursing
2
View this sample

It May Not Be Much, but It’s Honest Work!

Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.

0+

Happy Clients

0+

Words Written This Week

0+

Ongoing Orders

0%

Customer Satisfaction Rate
image

Process as Fine as Brewed Coffee

We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.

See How We Helped 9000+ Students Achieve Success

image

We Analyze Your Problem and Offer Customized Writing

We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.

  • Clear elicitation of your requirements.
  • Customized writing as per your needs.

We Mirror Your Guidelines to Deliver Quality Services

We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.

  • Proactive analysis of your writing.
  • Active communication to understand requirements.
image
image

We Handle Your Writing Tasks to Ensure Excellent Grades

We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.

  • Thorough research and analysis for every order.
  • Deliverance of reliable writing service to improve your grades.
Place an Order Start Chat Now
image

Order your essay today and save 30% with the discount code Happy