CPU scheduling Flashcards
What are the types of scheduling? And which one is meant for CPU?
① long term scheduling: - keep ready to run processes on disk storage and load them into memory as needed
- long term scheduler decides which process to be loaded into main memory.
_ controls maximum of number processes that be can run in a time shared fashion.
② short term scheduling ( cpu) → select a process from a ready queue and allocates CPU
You executes much more frequently when compared to long term.
What are the two queues that The processes move between during their life cycle?
① ready queue → processes that are in ready state. ② wait → processes that are blocked or waiting for io or interrupts
Does a typical process consists of cycles of CPU execution and IO?
True load; add, read, write (CPU bursts) then io bursts
What kind of bound does processes here?
① CPU bound ②IO bound
What is the difference between CPU and IO bound processes?
CPU bound processes have long CPU bursts while io bound have short CPU bursts
What is the impact of IO and CPU borne processes on long term and short term scheduling?
- Long term scheduler should select a good mix of IO and CPU bound processes
- ensures that both ready queues and wait queues are balanced and not empty.
What is the difference between preemptive and non preemptive scheduling?
① non-preemptive → each running process keeps the CPU until
- it completes
Or switches to the waiting state preemptive
② preemptive → a process might be forced to release CPU even though it is neither completed or blocked
This happens when in time sharing systems when the running process reaches the end of its time slice.
What metrics can be used to compare different scheduling polices.?
① CPU Utilization → percentage of time CPU is busy executing jobs.
② Turnaround time TA → amont of time to execute a particular process.
③ wait time → amount of time a process can wait in the ready queue
④ Response time → amount of time it takes from when a request is submits and the first response it produced,not the complete output.
TA formula
TA = T(COMPLETION) - T (arrival)
Waiting time formula Tw
Tw = TA -T ( cpu time size)
Response time formula
Tr = T ( start execution ) - T ( arrival)
What is FCFS
Process that arrives first runs first. FIFO
What is convoy effect?
Number of relatively short processes get queues behind a heavy weight process
What is shortest job first scheduling?SJF
The CPU is assigner to the process with the smallest next CPU time
What are the scheme of SJF?
- Non-preemptive
- preemptive → Shortest time to completion first STCF