CPU SCHEDULING Flashcards

1
Q

Define a CPU burst

A

The amount of time a process uses the processor
before it is no longer ready (aka Execution time)

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

What are the different types of CPU bursts

A
  • long bursts – process is CPU bound (i.e. array work)
  • short bursts – process I/O bound
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the different scheduling criteria to compare scheduling algorithms

A

CPU Utilization
Throughput
Turnaround time
Waiting time
Response time

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

Describe CPU utilization as a criterion

A

Ideally the CPU would be busy 100% of the time, so as to waste
0 CPU cycles. On a real system CPU usage should range from
40% ( lightly loaded ) to 90% ( heavily loaded. )

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

Describe throughput as a criterion

A

Number of processes completed per unit time. May range from 10 / second to 1 / hour depending on the specific processes.

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

Describe Turnaround time as a criterion

A

Time required for a particular process to complete, from
submission time to completion. ( Wall clock time. )

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

Describe waiting time as a scheduling criterion

A

-How much time processes spend in the ready queue
waiting their turn to get on the CPU.
-( Load average - The average number of processes sitting in the ready queue waiting their turn to get into the CPU. Reported in 1-minute, 5-minute, and 15-minute averages by “uptime” and “who”. )

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

Describe response time as a scheduling criterion

A

The time taken in an interactive program from the
issuance of a command to the commence of a response
to that command.

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

List 6 examples of CPU scheduling algorithms

A

First-Come, First-Served (FCFS) Scheduling Algorithm Shortest-Job-Next (SJN) Scheduling Algorithm
Priority Scheduling Algorithm
Shortest Remaining Time First (SRTF) Scheduling Algorithm
Round Robin(RR) Scheduling Algorithm
Multiple-Level Queues Scheduling Algorithm
* Multi-level feedback Queues Scheduling Algorithm

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

Differentiate between preemptive and non-preemptive algorithms

A

Non-preemptive algorithms are designed so that once a
process enters the running state, it cannot be preempted
until it completes its allotted time, whereas the preemptive scheduling is based on priority where a scheduler may preempt a low priority running process anytime when a high priority process enters into a ready state

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

Describe the First Come Firs Serve algorithm

A
  • Jobs are executed on first come, first serve basis.
  • It is a non-preemptive scheduling algorithm.
  • Easy to understand and implement.
  • Its implementation is based on FIFO queue.
  • Poor in performance as average wait time is high.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe the Shortest Job Next algorithm

A

-This algorithm picks a process based on the next shortest CPU burst,
- This is a non-preemptive, pre-emptive scheduling algorithm.
- Best approach to minimize waiting time.
- Easy to implement in Batch systems where required CPU time is known in advance.
- Impossible to implement in interactive systems where required CPU time is not known.
- The processer should know in advance how much time process will take.

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

Describe priority based algorithm

A
  • Priority scheduling is a non-preemptive algorithm and one of the most common scheduling algorithms in batch systems.
  • Each process is assigned a priority. Process with highest priority is to be executed first and so on.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How is priority determined? What happens when processes have the same priority

A
  • Priority can be decided based on memory requirements, time requirements or any other resource requirement.
  • Processes with same priority are executed on first come first served basis.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Describe the round robin algorithm

A

CPU bursts are assigned with a small unit of CPU time
called time quantum.
- When a process is given the CPU, a timer is set for whatever value has been set for a time quantum.
- If the process finishes its burst before the time quantum
timer expires, then it is swapped out of the CPU just like the normal FCFS algorithm.
- If the timer goes off first, then the process is swapped out of the CPU and moved to the back end of the ready queue.
- The ready queue is maintained as a circular queue, so when all processes have had a turn, then the scheduler gives the first process another turn, and so on.

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

How does the time quantum affect the performance of the round robin algorithm

A
  • The performance of RR is sensitive to the time quantum selected. If the quantum is large enough, then RR reduces to the FCFS algorithm; If it is very small, then each process gets 1/nth of the processor time and share the CPU equally.
  • BUT, a real system invokes overhead for every context switch, and the smaller the time quantum the more context switches there are.
    -Most modern systems use time quantum between 10 and 100 milliseconds, and context switch times on the order of 10 microseconds, so the overhead is small relative to the time quantum.
17
Q

Describe Shortest Remaining Time First (SRTF) Scheduling Algorithm

A
  • This Algorithm is the preemptive version of SJF scheduling.
    -In SRTF, the execution of the process can be stopped after a certain amount of time.
    -At the arrival of every process, the short term scheduler schedules the process with the least remaining burst time among the list of available processes
    and the running process.
  • Once all the processes are available in the ready queue, no preemption will be done and the algorithm will work as SJF scheduling.
18
Q

Describe the Multilevel Queue Scheduling algorithm

A

When processes can be readily categorized, then multiple separate queues can be established, each implementing whatever scheduling algorithm is most appropriate for that type of job, and/or with different parametric adjustments.

Note that under this algorithm jobs cannot switch from
queue to queue - Once they are assigned a queue, that is their queue until they finish.

19
Q

How is scheduling done between queues in multilevel queue algorithm

A

Two common options are strict priority (no job in a lower
priority queue runs until all higher priority queues are empty) and round-robin (each queue gets a time slice in turn, possibly of different sizes.)

20
Q

Describe Multilevel Feedback-Queue Scheduling Algorithm, its advantage and disadvantage

A

-Multilevel feedback queue scheduling is similar to the ordinary multilevel queue scheduling described above, except jobs may be moved from one queue to another
-Multilevel feedback queue scheduling is the most flexible, because it can be tuned for any situation. But it is also the most complex to implement because of all the adjustable parameters.

21
Q

What are some of the possible reasons why a job may be moved from one queue to another in the Multilevel Feedback-Queue Scheduling Algorithm

A
  • If the characteristics of a job change between CPU-intensive and I/O intensive, then it may be appropriate to switch a job from one queue to another.
  • Aging can also be incorporated, so that a job that has waited for a long time can get bumped up into a higher priority queue for a while.
22
Q

What are some of the parameters considered in the Multilevel Feedback-Queue Scheduling Algorithm

A

-The number of queues.
- The scheduling algorithm for each queue.
- The methods used to upgrade or demote processes from one queue to another. ( Which may be different. )
- The method used to determine which queue a process
enters initially.