DSA All Exams Programs
DSA All Exams Programs
BUDDY SYSTEMS
APPLICATION OF QUEUES Disadvantage of Round-robin Scheduling • If slicing time
1. Scheduling of OS is low, the processor output will be reduced. • This
The process scheduling is the activity of the process method spends more time on context switching • Its
manager that handles the removal of the running process performance heavily depends on time quantum. • Round-
from the CPU and the selection of another process on the robin scheduling doesn’t give special priority to more
basis of a particular strategy. Process scheduling is an important tasks. • Lower time quantum results in higher
essential part of a Multiprogramming operating systems. the context switching overhead in the system. • Finding a
Such operating systems allow more than one process to be correct time quantum is a quite difficult task in this system.
loaded into the executable memory at a time and the APPLICATION OF TREES
loaded process shares the CPU using time multiplexing. Huffman Tree
The OS maintains all Process Control Blocks (PCBs) in Huffman coding is an entropy encoding algorithm
Process Scheduling Queues. The OS maintains a separate developed by David A. Huffman that is widely used as a
queue for each of the process states and PCBs of all lossless data compression technique. The Huffman coding
processes in the same execution state are placed in the algorithm uses a variable length code table to encode a
same queue. When the state of a process is changed, its source character where the variable-length code table is
PCB is unlinked from its current queue and moved to its derived on the basis of the estimated probability of
new state queue. The OS can use different policies to occurrence of the source character. The key idea behind
manage each queue (FIFO, Round Robin, Priority, etc.). The Huffman algorithm is that it encodes the most common
OS scheduler determines how to move processes between characters using shorter strings of bits than those used for
the ready and run queues which can only have one entry less common source characters. The algorithm works by
per processor core on the system; in the above diagram, it creating a binary tree of nodes that are stored in an array.
has been merged with the CPU. A node can be either a leaf node or an internal node.
2. Round Robin Scheduling Initially, all the nodes in the tree are at the leaf level and
Round Robin scheduling algorithm is one of the most store the source character and its frequency of occurrence
popular scheduling which can actually be implemented in also known as weight.
most of the operating systems. This is the preemptive
version of first come first serve scheduling. The Algorithm
focuses on Time Sharing. In this algorithm, every process
gets executed in a cyclic way. A certain time slice is defined
in the system which is called time quantum. Each process
present in the ready queue is assigned the CPU for that
time quantum, if the execution of the process is completed
during that time then the process will terminate else the
process will go back to the ready queue and waits for the
next turn to complete the execution.