Process Scheduling Flashcards

1
Q

Processor manager

A

Uses one or more scheduling algorithms to dispatch processes.

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

Non-preemptive scheduling

A

Process stays on the CPU until it terminates or blocks for I/O, implements multiprogramming.

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

Preemptive scheduling

A

Implements multitasking and can be interrupted and replaced with another process.

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

Processor Manager Objectives

A

Maximise throughput
Minimise turnaround time
Minimise waiting time
Maximise CPU efficiency
Minimise latency
Its not possible to have all of these criteria fulfilled at once as they clash with one another, therefore the processor manager tries to ensure fairness.

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

Burst Time

A

Time a process takes on the CPU before it blocks or terminates.

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

Arrival Time

A

Time a process is first put into the ready state.

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

First Come First Served

A

Deals with processes according to their arrival time.
Uses a FIFO order to store ready processes.
When a new process is added, its PCD is added to the back of the ready queue.

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

FCFS Average Wait Time

A

The time can change if the biggest one is last, as the biggest time is not considered as part of the equation.

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

FCFS Advantages and Disadvantages

A

Advantages:
- Very simply implementation.
- Scheduling overhead is minimal during content switch, since you just get the next one in the ready queue that the pointer points to.
- No starvation of processes, which means they will run eventually.
Disadvantages:
- Throughput can be low due to long processes staying on CPU.
- Average wait time is not minimal.
- Turnaround time and latency are therefore hard to predict.
- No ability to prioritise processes.
If bigger processes went last, speed would increase.

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

Shortest Job First

A

When the CPU becomes free, the scheduler will choose the process with the shortest burst time. If two are the same, we just choose by arrival time. Similar to FCFS, it stays there until terminated.

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

SJF Average Wait Time

A

The average wait time will be shorter than FCFS, because it does the minimal one first.

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

SJF Advantages and Disadvantages

A

Advantages:
- Reduces overall average wait time.
- Probably optimal in giving AWT for given (average wait time) processes.
Disadvantages:
- Can lead to process starvation, could lead to starving the OS.
- Difficult to estimate burst times for new processes, since it relies on prior history.

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

Shortest Remaining Time First

A

Instead of looking at burst time, it simply just looks at how long it has left to process. So whatever is on the CPU can be taken off before it finishes, and whatever has a shorter remaining time until it terminates or it is blocked. This is very hard to calculate, and therefore it is hard to draw a Gaant chart for.

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

SRTF Advantages and Disadvantages

A

Advantages:
- Short processes are handled very quickly.
- Gives maximum throughput in most situations.
- Requires little overhead during context switch.
Disadvantages:
- Starvation is still possible.
- Introduces extra context switches.
- Waiting time can increase for longer processes.

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

Throughput

A

-> get through x amount of processes in y amount of time.

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

Minimise Turnaround Time

A

-> minimise time taken for processes to complete.

17
Q

Minimise waiting time

A

-> reduce time processes spend in ready state.

18
Q

Maximise CPU efficiency

A

-> keep CPU constantly busy.

19
Q

Minimise latency

A

-> reduce time taken between request and response.

20
Q

Priority Scheduling

A

A preemptive algorithm that gives preferential treatment to important processes; each process has priority assigned to it, with the highest priority getting onto the CPU first.
Equal priority just uses FCFS, and if a new process arrives with a higher priority arrives than the current priority, it interrupts it and places itself on the CPU.
Priorities can depend on things like memory usage, I/O throughput, total CPU time and time already elapsed.

21
Q

Priority Scheduling Average Wait Time

A

Add up priorities in terms of their wait time (ms).

22
Q

Priority Scheduling Advantages

A
  • Smaller wait time and latency for higher priority.
  • Important priorities are dealt with quickly.
23
Q

Priority Scheduling Disadvantages

A
  • Bigger wait times and latency for lower priority.
  • Starvation is possible.
24
Q

Round Robin Scheduling

A

Preemptive, and uses time slice (quantum; typically between 10ms and 100ms) to give a set amount of CPU time to each process.
Similar to FCFS but can be interrupted before they terminate or block.
The ready state is similar to a circular FIFO queue:
- New processes arrive back of queue.
- Scheduler takes next process from front.
- Process runs for set amount of time.
- Context switch moves current process to back of queue and dispatches next in line.
- This repeats.
If the burst time is less than the quantum time, the process will terminate or block for I/O, and will immediately take next process from queue and place on CPU. If quantum time < burst time, it will be interrupted and context switch will happen (preempted).
If quantum is too big, similar to FCFS.
If quantum is too small, similar to SJF.

25
Q

Round Robin Turnaround and Wait Time

A

To calculate AWT, we use turnaround time and wait time.

Turnaround -> time when it was terminated - when it arrived
Equations = wait time + burst time
or
Completion time - arrival time

Wait -> turnaround - burst.

26
Q

Round Robin Advantages

A
  • Easy to implement as queue.
  • No guessing times.
  • Response time based upon number of processes, not burst time.
  • No starvation
  • Balanced throughput
27
Q

Round Robin Disadvantages

A
  • Depends on selecting good quantum times
  • Extensive overhead if quantum is too short.