Operating System: Process Management

Scheduling concept



Scheduling concept

What do understand by scheduling and scheduler?

 Scheduling: Scheduling refers to a set of policies and mechanism into operating system and that govern the order in which the work to be done by a computer system os complicated.

Scheduler: Scheduler is an OS module that selects the next job to be admitted into the system and the next process to run.

What do you know about dispatcher?

The dispatcher is the module that actually gives control of the CPU to the process selected by the short-term scheduler. This function involves loading the register of the process, switching of user mode, and jumping to the proper location in the user program to restart it. Obviously, the dispatcher should be as fast as possible.

Scheduling criteria and Algorithms.

Write short notes on: Throughput, Wait time , Turnaround time, Response time.

Throughput: The number of jobs which are completed per time unit. Throughput allows maximum number of jobs of complete.

Wait time: The amount of time  a jobs spends waiting in the ready queue.

Turnaround time:  The time between submission & completion.

Response time: The amount of time it takes to starts responding.

What are the important factors of scheduling mechanism?

Factors which affect a scheduling mechanism are:
i)                   I/O boundedness of a process
ii)                 CPU boundedness of a process
iii)               Is the process interactive or batch
iv)               Process priority
v)                 Page fault frequency
vi)               Preemption frequency
vii)             Execution time received
viii)           Execution time required to complete



FCFS and SJF algorithms


FCFS and SJF algorithms



What are the characteristics of FCFS and SJF algorithms? How can they be implemented?

FCFS:

Implementation:
The implementation of FCFS id easily managed with a FIFO (First-in-First-out) queue. As the process becomes ready, it joins the ready queue when the current process finishes, the oldest process is selected next.
Characteristics:
i)                   Simple to implement
ii)                 Non-preemptive
iii)               Penalize short and I/O bound process.


SJF:
Implementation:
A different approach to CPU scheduling is the Shortest-Job-First (SJF) algorithms. Shortest-Job-First associates with each job the length of its next service time. If two jobs have the same next CPU burst, FCFS is used. The process with the shortest expected execution time is given priority on the processor.

Characteristics:
i)                   Non-preemptive
ii)                 Reduces average waiting time over FIFO
iii)               Must know how long a process will run
iv)               Possible user abuse.


What is indefinite blocking? How it is caused?

Indefinite blocking is a process which is ready to run but lacking the CPU can be considered blocked, waiting for the CPU. A priority scheduling algorithms can leave some low-priority processes, waiting indefinitely for the CPU.
Starvation results from the ranking scheme having a problem that means one or more elements are continually overlooked and other elements are given preference. They are indefinitely postponed or suffer from starvation when they are never the highest ranking element.

How may an operating system/algorithm avoid undefined blocking?

 A solution to the problem of low-priority jobs is aging. Aging is a technique of gradually increasing the priority of jobs that wait in the system for a long time.

How RR scheduling algorithm works?

 To implement round-robin scheduling, the ready queue is kept as a FIFO queue of processes. New processes are added to the tail of the ready queue. The CPU scheduler picks the first job from the ready queue, sets a timer to interrupt after one tone quantum, and dispatches the process.

What do you know about quantum size?

A small unit of a time, called a time quantum or time slice, is defied. A time quantum is generally from 10 to 100 milliseconds.

Deciding on the size of quantum is important as it affects the performance of the Round Robin algorithm.
i)                   Large or small quantum
ii)                 Fixed or variable quantum
iii)               Same for everyone or different.


What is context switch?

 We have problem, specifically, at the end of each time quantum, we get an interrupt from the timer. Processing the interrupt to switch the CPU the old process requires saving all the resisters for the old process and loading the registers for the new process. This task is known as a context switch.

What is the effect of context switch on RR?

Ans: To illustrate the effect of context switch time on the performance of round-robin scheduling, let’s assume thet we have only one job of 8 time nits. If the quantum is 10 time units, the job finishes in less than one time quantum,with no overhead. If the quantum is 5 time units, however , the job requires two quanta, resulting in a context switch. If the time quanta is 1 time unit , then 7 context switches will occur, slowing the execution of the job accordingly .

      


Comments