CPU scheduling Flashcards

1
Q

What are the types of scheduling? And which one is meant for CPU?

A

① 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two queues that The processes move between during their life cycle?

A

① ready queue → processes that are in ready state. ② wait → processes that are blocked or waiting for io or interrupts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Does a typical process consists of cycles of CPU execution and IO?

A

True load; add, read, write (CPU bursts) then io bursts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What kind of bound does processes here?

A

① CPU bound ②IO bound

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between CPU and IO bound processes?

A

CPU bound processes have long CPU bursts while io bound have short CPU bursts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the impact of IO and CPU borne processes on long term and short term scheduling?

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between preemptive and non preemptive scheduling?

A

① 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What metrics can be used to compare different scheduling polices.?

A

① 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

TA formula

A

TA = T(COMPLETION) - T (arrival)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Waiting time formula Tw

A

Tw = TA -T ( cpu time size)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Response time formula

A

Tr = T ( start execution ) - T ( arrival)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is FCFS

A

Process that arrives first runs first. FIFO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is convoy effect?

A

Number of relatively short processes get queues behind a heavy weight process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is shortest job first scheduling?SJF

A

The CPU is assigner to the process with the smallest next CPU time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the scheme of SJF?

A
  • Non-preemptive
  • preemptive → Shortest time to completion first STCF
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When is non preemptive SJF optimal?

A

① if all the processes are ready simultaneously
② gives minimum average waiting time for a given set of processes.

17
Q

When is preemptive SJF is optimal?

A

Thank it processes May arrive at different times however they have poor response time

18
Q

When is response time optimal?

A

Response time is optimal with round Robin but it has worst turnround time