Sie sind auf Seite 1von 14

TERM PAPER ON

Compare CPU Scheduling of LINUX and UNIX.

Lovely Professional University


Phagwara (Punjab)
OPERATEING SYSTEM (CSE316)
In
Computer Science and Engineering
By
MOHIT ARORA (11102460)
SECTION-K3101
ROLLNO-A05

Under the guidance of


BALWINDER KAUR MAM
(Asstt. Professor)

INDEX
1.
2.
3.
4.
5.
6.
7.
8.
9.

Introduction
Acknowledgement
Introduction to UNIX
UNIX scheduling algorithms
Problems in UNIX scheduling
Introduction to Linux
Linux process scheduling
Conclusion
References

ACKNOWLEDGEMENT
I wish to express my deepest gratitude and warmest
appreciation to the following people, who, in any way have
contributed and inspired me to the overall success of the
undertaking term paper BALVINDER KAUR MADAM who
had assigned me this job to enhance my knowledge, my
parents who had been the continuous source of financial aid and
moral support and then my roommates who helped me to
complete my work on time.

INTRODUCTION
To manage all the processes in ready queue for the maximum
utilization of cup, this job is done by the process scheduler on
the basis of scheduling algorithms .scheduling is a key concept
in computer multitasking, multiprocessing operating system and
real time operating system designs. Scheduling refers to the way
processes are assigned to run on the available cups since there
are many more processes this assignment is carried out by
software known as a scheduler and dispatcher.

WHAT IS A PROCESS SCHEDULER?


It takes the job from the ready queue and dispatches it to cpu
according to scheduling algorithms.
Scheduler is mainly concerned with the followingCPU UTILIZATION-To keep the cpu as busy as possible.
THROUGHPUT- Number of processes that complete their
execution per time unit.
TURNAROUND Total time between the sub mission of
a process and its completion.
WAITING TIME- Amount of time a process has been
waiting in the ready queue

WHAT IS SCHEDULEING ALGORITHMS??


There are the sums of instructions or system calls the followed
by scheduler to take job to CPU

TYPES OF SCHEDULEING ALGORITHMSPrimitive- these are those jobs in which we can take cpu back
from the running process and reassign it after some time.
Primitive algos*Round Robin
*Priority based
* S h o r t e s t r e m a i n i n g time
Non-Primitive: these are those jobs in which we cant take
CPU back from the running process.

Non-Primitive algos:
*First come First serve
*Priority based
*Shortest job first

INTRODUCTION ABOUT UNIX


Unix (officially trademarked as UNIX, sometimes also written as
UNIX with small caps) is a computer operating system originally
developed in1969 by a group of AT&T employees at Bell Labs ,
including Ken Thompson, Dennis Ritchie ,Brian Kernighan ,Dougla
McIlroy,and Joe Ossanna. Today's Unix systems are split into
various branches, developed over time by AT&T as well as various

commercial vendors and non-profit organizations. The Open


Group, an industry standards consortium, owns the Unix
trademark. Only systems fully compliant with and certified
according to the Single UNIX Specification are qualified to use the
trademark; others might be called "Unix system-like" or "Unixlike" (though the Open Group disapproves of this term).However,
the term "Unix" is often used informally to denoteany operating
system that closely resembles the trade marked system. During
the late 1970s andearly 1980s, the influence of Unix in academic
circles led tol arge-scale adoption of Unix (particularly of the BSD
variant, originating from the University of Californic Berkeley) by
commercial startups, the most notable of which are Solaris,HP-UX
and AIX. Today, in addition to certified Unix systems such as
those already mentioned,Unix-likeoperating systems such as
Linux and BSD descendants (FreeBSD, NetBSD, andOpenBSD) are
commonly encountered. The term "traditional Unix" may be used
to describe a Unix or an operating system that has
the characteristics of either Version 7Unixor UNIX System V.

UNIX scheduling algorithms


UNIX uses MULTIFEEDBACK QUEUE
Runnable processes are assigned to run queues on their priority.
TIME SLICED FOR THEPROCESSES IS INFOLLOWING
MANNER :
*Run queues are scanned From top to bottom
*First process on non-empty queue is run
*processes on a queue are run round robin with equal time slices
*blocking processes are removed from run queue processes
using up their time slice are scheduled at end of queue

SCHEDULING PRIORITIESIN THE PROCESSING


Scheduling priorities are dynamically adjusted to reflect
*requirements for resources recent
*CPU usage and processes shuffled between queues
accordingly.
Users express requirements for processes via
Nice factors that improve process priority the lower they are
lie between -20 (high) and20 (low) (default 0)
user may only set between 0 and 20 unless super user
NOTE:
UNIX doesn't preemptor context switch processes in kernel
mode.

Problems in UNIX Scheduling


A) They do not provide adequate support for SMP systems

B) They do not scale well as the number of tasks on the


system grows.
INTRODUCTION TO LINUX
Linux (commonly pronounced LIN-ks in American
English,
in Europe and Canada) refers to the family of UNIX like
computer operating systems using the Linux kernel. Linux can
be installed on a wide variety of computer hardware, ranging
from, tablet computers and video game console, to mainframes
and super computers. Linux is the leading server OS, accounting
for more than 50% of installations and runs the top 10 fastest
super computers in the world. Desktop use of Linux has
increased in recent years, partly owing to the popular Ubuntu,
Fedora, and opens USE distributions and the emergence of net
books and smart phones running an embedded Linux .The
development of Linux is one of the most prominent examples
of free and open source software collaboration .typically all the
underlying source code can be used, freely modified, and
redistributed, both commercially and non-commercially, by
anyone under licenses such as the GNU General Public
License .Typically Linux is packaged in a format known as a
Linux distribution for desktop and server use.
Linux distributions include the Linux kernel and all of the
supporting software required to run a complete system, such as
utilities and libraries, the XWindow System the GNOME and
KDE desktop environments and the Apache HTTP

Server .Commonly used applications with desktop Linux


systems include the Mozilla Firefox web-browser, the
OpenOffice.org office application suite and the GIMP image
editor. The name "Linux" comes from the Linux kernel,
originally written in 1991 by Linus Torvalds .The main
supporting user space system tools and libraries from the GNU
Project (announced in 1983 byRichard Stallman) are the basis
for the Free Software Foundation's preferred name
GNU/Linux.
In Linux, all process runs with their own respective scheduling
priorities and process attributes on every CPU cycle that simply
affect show Linux kernel sets CPU resources and process
priorities to a particular PIDS. There are three categories of
Linux scheduling policies namely:
a. SCHED_OTHER - this is the default Linux scheduling
policy.
b. SCHED_FIFO - stands for FIFO, first in first out policy
scheme.
c. SCHED_RR, or SCHED_BATCH - stand for Linux roundrobin schedule policy. This Linux blog entry covers an
alternative approach, besides from using nice and renice, on
priority scheduling of Linux process and threads. Process
scheduling and application prioritization is a must to know
specially on thousand server farms and/or enterprise world of
Linux computing.

Linux process Scheduling


The Linux kernel ran a variation of the traditional UNIX
scheduling algorithm.

Linux scheduler
Uses PREEMITIVE PRIORITYBASED SCHEDULING
ALGORITHM Linux assigns higher-priority tasks longer time
quanta and lower-priority tasks shorter time quanta.The
relationship between priorities and time-slice length
A runnable task is considered eligible for execution on the CPU
as long as it has time remaining in its time slice. When a task
has exhausted its time slice, it is considered expired and is not
eligible for execution again until all other tasks have also
exhausted their time quanta. The kernel maintains a list of all
run able tasks in arunqueue data structure. Because of its support
for SMP, each processor maintains its own runqueue and

schedules itself independently. Each run queue contains two


priority arrays active and expired.
ACTIVEThe active array contains all tasks with time remaining in their
time slices, and the expired array contains all expired tasks.
Each of these priority arrays contains a list of tasks indexed
according to priority the scheduler chooses the task with the
highest priority from the active array for execution on the CPU.
On multiprocessor machines, this means that each processor is
scheduling the highest-priority task from its own run queue
structure. When all tasks have exhausted their time slices (that
is, the active array is empty), the two priority arrays are
exchanged.
The expired array becomes the active array, and vice
versa. Linux implements real-time scheduling as defined by
POSIX.lb. Real-time tasks are assigned static priorities. All
other tasks have dynamic priorities that are based on their
Nice Values plus or minus the value 5. The interactivity of a task
determines whether the value 5 will be added to or subtracted
from the nice value. A task's interactivity is determined by how
long it has been sleeping while waiting for I/O.

Tasks that are more


interactive typically have longer sleep times and therefore are
more likely to have adjustments closer to -5, as the scheduler

favors interactive tasks. The result of such adjustments will be


higher priorities for these tasks. Conversely, tasks with
shorter sleep times are often more CPU- bound and thus will
have their priorities lowered. There calculation of a task's
dynamic priority occurs when the task has exhausted its time
quantum and is to be moved to the expired array. Thus, when the
two arrays are exchanged, all tasks in the new active array have
been assigned new priorities and corresponding time slices

CONCLUSION
LINUX uses much better algorithms than UNIX uses
MULTIFEEDBACK QUEUE there actually we use 3
algorithms different for different stages .so they do not provide
adequate support for a SMP system ..
THEY do not scale well as the number of a tasks on the system
grows but in ROUND ROBIN large queues are also managed
well..

Refrences
*Wikipedia
*www.Computers world .com
*www.informit.com
*www.linux .com
*www.unix.com

Das könnte Ihnen auch gefallen