0% found this document useful (0 votes)
559 views

Unix Scheduling

Uploaded by

fitsumseid92
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
559 views

Unix Scheduling

Uploaded by

fitsumseid92
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Unix scheduling

Process Scheduling
• Process scheduling is the process of determining
which processes should be allocated to the CPU and
in what order.
• It is an important part of operating system design, as
it determines how efficiently the system can utilize
its resources.
• In Unix-like operating systems, process scheduling is
handled by the scheduler, which uses a variety of
algorithms to determine which processes should be
given priority.
Unix Scheduling
• Unix scheduling is the process of assigning tasks to be
performed by the operating system. It is responsible for
deciding which processes should be executed when and
for how long.
• The scheduler is responsible for allocating resources such
as CPU time, memory, and disk space to each process. It
also determines the order in which processes are executed
and how much time each process is allowed to use.
• Unix scheduling algorithms are designed to ensure that all
processes get a fair share of resources and that no single
process monopolizes the system.
Features of UNIX scheduling
• UNIX scheduling is preemptive, time-sharing, and
priority-based
 Unix systems use preemptive scheduling, which
means that the operating system can interrupt a
process that is running and assign the CPU to
another process.
 Unix systems use priority-based scheduling, which
means that processes are assigned a priority level
and the highest priority process is given the most
CPU time.
 Time-sharing: Unix systems are capable of multitasking,
which means that multiple processes at the same
priority level can run in parallel each of them is given a
time slice after the time is expired the next process
with the same priority will run.
 Unix systems use round robin scheduling, which means
that each process is given a fixed amount of time to run
before being switched out for another process.
 Unix scheduling is different in user and kernel mode. In
user mode, the scheduler is responsible for managing
the execution of processes and threads, while in kernel
mode, the scheduler is responsible for managing the
execution of interrupts and system calls.
Kernel mode scheduling
• Kernel mode scheduling in Unix scheduling is the process
of assigning priority to processes that are running in
kernel mode.
• Kernel mode processes are those that have direct access
to the hardware and system resources, such as device
drivers, system calls, and interrupt handlers.
• These processes are given higher priority than user-
mode processes, which are those that run in user space.
• Kernel mode scheduling ensures that kernel-mode
processes get the resources they need to complete their
tasks quickly and efficiently.
User-mode scheduling
• User-mode scheduling is used to allow multiple
processes to run concurrently on a single processor.
• It works by assigning each process its own time slice, or
quantum, and then switching between them in a round-
robin fashion.
• This allows the system to make efficient use of the
processor's resources, as each process can be given its
own dedicated time slice.
• User-mode scheduling also helps to prevent one process
from monopolizing the processor's resources, as it will
be preempted after its allotted time has expired.
Priority classes of Unix scheduling
• Real-time: This is the highest priority class and is used for
tasks that must be completed within a certain time frame.
Examples include controlling industrial machinery, controlling
robots, and providing audio/video streaming.
• Kernel: This priority class is used for tasks that are essential
to the operating system's functioning. Examples include
memory management, process scheduling, and device
drivers.
• Time-sharing: This priority class is used for tasks that are not
as time-sensitive as real-time tasks but still need to be
completed in a timely manner. Examples include user
applications such as word processors and web browsers.
• Here the priority is based on process type and execution
history. The priority of each process is recomputed once per
second with the following formula:

• where
CPUj (i) = Measure of processor utilization by process j through
interval i
Pj(i) = Priority of process j at beginning of interval i; lower
values equal higher priorities
Basej = Base priority of process j
nicej= user-controllable adjustment factor
• The purpose of the base priority is to divide all
processes into fixed bands of priority levels.
• The CPU and nice components are restricted to prevent
a process from migrating out of its assigned band
(assigned by the base priority level).
• These bands are used to optimize access to block
devices (e.g., disk) and to allow the operating system to
respond quickly to system calls.
• Nice value allows users to prioritize certain processes
over others, ensuring that important tasks are
completed first. It works by assigning each process a
nice integer value. Processes with higher nice values are
given lower priority than those with lower values.
Advantages of Unix Scheduling
• Unix scheduling is very efficient and reliable. It is
designed to handle multiple tasks simultaneously, so
it can be used to manage large workloads.
• Unix scheduling is highly customizable, allowing users
to set up their own scheduling rules and parameters.
This makes it easy to tailor the system to specific
needs.
• It is open source, meaning it can be freely modified
and distributed by anyone who wishes to do so.
• Unix scheduling is also very secure, as it uses access
control lists to restrict access to certain resources or
processes. This helps protect against malicious
attacks and unauthorized access.
• Unix scheduling is also very flexible, allowing users
to adjust the priority of tasks or processes as
needed. This makes it easy to prioritize important
tasks over less important ones.
• It has a wide range of features that make it suitable
for a variety of applications, from simple task
scheduling to complex job scheduling and resource
management
Disadvantages of Unix Scheduling
• It can also be difficult for users to troubleshoot
problems with the system if something goes wrong,
as there are many different components that need
to be configured correctly in order for the system to
work properly.
• Its lack of graphical user interface (GUI) makes it
difficult for novice users to understand how the
system works or how to set up tasks correctly
without assistance from an experienced user or
administrator.
• Additionally, some of the more advanced
features of Unix scheduling may require
additional software or hardware components
which may not be available on all systems or
may require additional costs for
implementation and maintenance.
• Finally, Unix scheduling can be resource-
intensive, as it requires a lot of memory and
processing power in order to run efficiently and
effectively manage multiple tasks
simultaneously

You might also like