intro Flashcards
what is an operating system
this is a software that acts as an interface/ intermediary between the user and the computer hardware
what is process scheduling and why is it important in an operating system
this is the process of removing a running process in the CPU and selection of another process in the basis of another strategy.
why is process scheduling important
(a) ensures that all resources o the CPU such as time, memory and i/o devices are shared equally among processes
(b) ensures that the computer has a fast response time
(c) ensures that every process is allocated enough time for execution in the CPU
(d) ensures that the CPU is busy that maximizing its utilization
define between short term, medium term and long term scheduling
short term scheduling selects the processes that are ready and allocates them to the CPU
long term scheduling determines which process is ready for administration into the system,
medium term removes the process
Explain the difference between preemptive and non-preemptive scheduling
preemptive scheduling is a type of scheduling where there can be an interruption during execution while non preemptive scheduling is a type of scheduling where no interruptions are allowed until the execution is done
How does the First-Come-First-Serve scheduling algorithm work?
the process that requests the CPU first will be the first one to be executed
What are the advantages and disadvantages of FCFS scheduling?
advantages
(a) simple to understand
(b) no starvation
disadvantages
(a) convoy effect
(b)non preemptive
(c) dependence on arrival time
Discuss a scenario where FCFS might lead to the “convoy effect.”
if the process with a higher execution time arrives before the process with the lower execution time, that process will have to wait for the process with the longer execution time to be done.
Explain the Shortest Job Next (SJN) scheduling algorithm.
this is a type of scheduling where the shortest process with the shortest CPU burst time will be the first to be get in the CPU and be executed
What is the main challenge with SJN, and how is it addressed in the Shortest Remaining Time First (SRTF) variant?
the main challenge is it cannot predict the total scheduling time accurately. the SRTF addresses the issue by re evaluating the remaining time for each jobs in the ready queue
Discuss the concept of “starvation” in SJF scheduling.
this is a situation where a process is unable to make progress since it keeps on being bypassed by the scheduler in favour of other processes. this happens when a longer process keeps constantly being bypassed by shorter processes by the scheduler
How does the Round Robin scheduling algorithm work?
processes are placed in the ready queue where the CPU scheduler goes round allocating the processes in the CPU and giving each process a time slice in which it will be executed
Discuss the impact of the time quantum on the performance of Round Robin.
Compare Round Robin with FCFS and SJF in terms of turnaround time and response time.
TURNAROUND TIME
in FCFS the turn around time depends on the process arrival therefore the process that arrived first has a lower turnaround time
in SJF the turn around time is lower for the shortest process
in RR it depends with the time quantum, the lower the quantum time the lower the turnaround time
RESPONSE TIME
in FCFS it has a higher response time for the processes that arrive later
in SJF has a lower response time since it prioritizes shorter jobs
in RR the shorter the time quantum the faster the response time
Explain the priority scheduling algorithm
the processes are grouped in priority value and the process with the highest priority value is executed first