Operating system Notes
Introduction of Operating System
PROCESS: Program to process, Lifecycle of the process, Process control block, IPC
Scheduling
Threads
Memory Management
File Management
Synchronization
Disk Management
IO Management
Protection And Security
Heading
Q
1
Mention criteria for optimal cpu scheduling.
Ans
CPU scheduling is a process that allows one process to use the CPU while the execution of another process is on hold(in waiting state) due to unavailability of any resource like I/O etc, thereby making full use of CPU. The aim of CPU scheduling is to make the system efficient, fast, and fair.
Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The selection process is carried out by the short-term scheduler (or CPU scheduler). The scheduler selects from among the processes in memory that are ready to execute and allocates the CPU to one of them.
Scheduling of processes/work is done to finish the work on time.
Below are different time with respect to a process.
Arrival Time: Time at which the process arrives in the ready queue.
Completion Time: Time at which process completes its execution.
Burst Time: Time required by a process for CPU execution.
Turn Around Time: Time Difference between completion time and arrival time.
Turn Around Time = Completion Time – Arrival Time
Waiting Time(W.T): Time Difference between turn around time and burst time.
Waiting Time = Turn Around Time – Burst Time
Q
2
What do you understand by preemptive and non-preemptive scheduling.
Ans
Preemptive Scheduling is a CPU scheduling technique that works by dividing time slots of CPU to a given process. The time slot given might be able to complete the whole process or might not be able to it. When the burst time of the process is greater than CPU cycle, it is placed back into the ready queue and will execute in the next chance. This scheduling is used when the process switch to ready state.
Algorithms that are backed by preemptive Scheduling are round-robin (RR), priority, SRTF (shortest remaining time first).
Non-preemptive Scheduling is a CPU scheduling technique the process takes the resource (CPU time) and holds it till the process gets terminated or is pushed to the waiting state. No process is interrupted until it is completed, and after that processor switches to another process.
Algorithms that are based on non-preemptive Scheduling are non-preemptive priority, and shortest Job first.
Q
3
Define i)CPU Utilization ii)Throughput iii)Turnaround time iv)Waiting time v)Response Time
Ans
Throughput: number of processes that complete their execution per time unit
Turnaround time: amount of time to execute a particular process
Waiting time: amount of time a process has been waiting in the ready queue
Response time: amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)
Q
4
What do you mean by CPU-burst and I/O burst?
Ans
CPU Burst :- "The amount of time the process uses the processor before it is no longer ready".
Types Of CPU burst :-
1. Long burst : ("Process is CPU bound")
2. Short burst : ("Process I/O bound")
I/O Burst :- "Input/Output burst is that after completion the input burst CPU do process on that job".
Explanation :- CPU burst is like a car and input Input burst is like a pedestrian , because CPU speed is much faster than Input Output burst , we can not reduce the speed of CPU burst but we can increase the Input Output speed.
Q
5
What is multilevel queue?
Ans
A multi-level queue scheduling algorithm partitions the ready queue into several seperate queues. The processes are permanently assigned to one queue, generally based on some property of process, such as memory size, process priority, or process type. Each queue has it own scheduling algorithm.