Scheduling Flashcards

(41 cards)

1
Q

What is CPU scheduling?

A

Determine which process to run next

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

Types of Scheduling

A
  • Short Term Scheduling
  • Medium Term Scheduling
  • Long Term Scheduling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is short term scheduling?

A

== dispatcher
* Determine which process to execute next
* Invoked after
– clock interrupt
– system calls and traps to kernel
– signals

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

What is medium term scheduling?

A
  • Swapping decisions
  • Memory management unit in kernel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is long term scheduling?

A
  • Determine which programs are admitted
  • Control degree of multiprogramming
  • If more processes are admitted
    – Less likely that all are blocked
    – Each process has a smaller fraction of the CPU
  • Could mix CPU bound and I/O bound
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When does CPU scheduling happen?

A

when processes:
1.switches from running to waiting state
2.switches from running to ready state
3.switches from waiting to ready
4.terminates

  • These are non-preemptive any other time is preemptive (interrupt)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Types of CPU scheduler

A
  • Long-term scheduler (or job scheduler)
  • Short-term scheduler (or CPU scheduler)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does a long-term scheduler do?

A

Selects which processes should be brought into the ready
queue

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

What are CPU scheduling algorithims based on?

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
13
Q

What is CPU utilization when it comes to CPU scheduling criteria?

A

Need to keep the CPU as busy as
possible ranging from 0 to 100%. In real systems it should
range from 40% (lightly loaded) to 90% (heavily used) system

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

What is throughput when it comes to CPU scheduling criteria?

A

Measure of the number of processes completed per unit time. E.g. a long processes this rate may be 1 process per hour, for short transactions can be 10 processes per second

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

What is turnaround time when it comes to CPU scheduling criteria?

A

This is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU and doing the IO

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

What is waiting time when it comes to CPU scheduling criteria?

A

This is the total time a process waits in the ready queue

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

What is response time when it comes to CPU scheduling criteria?

A

Time from the submission of a request until the 1st response is produced, but not the time taken to output that response

18
Q

List Short Term Scheduling Algorithms

A
  • First Come, First Served (FCFS)
  • Round Robin (RR)
  • Shortest Process Next (SPN)
  • Pre-emptive Shortest Process Next (PSPN)
  • Highest Response Ratio Next (HRRN)
  • Multiple-Level Feedback (FB)
  • Selfish Round Robin (SRR)
19
Q

Define Response Time (T)

A

This is a measure from the time a process arrives till it completes, so all the waiting time is included

20
Q

Define Response Time when it is measured

A

T: time that process p is present;
finish time – start time

21
Q

Define Wasted Time (W)

A

waiting time,
(completion time – arrival time) – processor run time

22
Q

Define Wasted Time when it is measured

A

W: Response Time (T) – time for execution (t)

23
Q

Define Penalty Ratio (P)

A

Is the inverse of response ratio so a penalty ratio of 1 is perfect which subsequently rises upwards

24
Q

Define Penalty Ratio when it is measured

A

P: Response Time (T)/time for execution (t)

25
Define Response Ratio (R)
Represents the fraction of the time that the process is receiving service e.g. if the response ratio R is 1 then the process never sits in the ready queue I.e. its always in the running state.
26
Define Response Ratio when it is measured
R: time for execution (t)/Response Time (T)
27
What is First Come, First Served (FCFS)?
The process that have been waiting the longest will be served 1st. This is a non pre-emptive method.
28
What are the drawbacks to First Come, First Served (FCFS)?
The processes that don't performing I/O will monopolise the CPU This algorithim favours CPU bound processes so: * I/O bound have to wait until CPU bound completes * May wait after I/O completed (poor device utilisation) * Could give priority to I/O bound processes
29
What is Round Robin (RR)?
A scheduling algorithim that tries to provide good response ratios for both short and long processes, it also sets q (quantum) so that the CPU is fairly shared and there is not to much swapping
30
How long does a process last when using the round robin algorithim?
The round robin policy services a process only for a single quantum q of time Typical values of q range between 1/60 and 1 second.
31
What happens in a round robin if a process is interrupted?
If a new process hasn’t finished within its quantum it is interrupted at the end of the quantum and placed at the end of the of the wait queue and wait for its turn to run for another quantum, this continues until the process completes
32
Why do we define q in round robin?
We define q ( no. of execution units) so that once a process finishes its allotted q time then its placed at the back of the queue New processes are placed at the back of the queue and the process at the front of the queue is executed next
33
What is Shortest Process Next (SPN)?
An algorithim that requires explicit information on the service time required for each process It simply selects from the ready list the process with the shortest service time to run next This as a result will favour processes with a short service time This is a non pre-emptive method
34
What is Preemptive Shortest Process Next (PSPN)?
When the current process is swapped when another process arrives with a total service time less than the remaining service time of the running process
35
What is Highest Response Ratio Next (HRRN)?
Where w = time spent on system so far, waiting and executing s = total service time is required by the process including the time spent executing This a non-preemptive method
36
What is the equation used for each process in Highest Response Ratio Next (HRRN)?
max((w+s)/s)
37
What is the problem with Highest Response Ratio Next (HRRN)?
The overhead can be high as we need to calculate for each process on the queue the selection function
38
What is Multiple Level Feedback (FB)?
This method splits the ready list into a number of queues: queue 0, queue 1, queue 2 and so on Where the lower numbered queues have the highest priority hen the current process is interrupted at the end of its quanta A new process is selected from the front of the lowest numbered queue
39
What is Selfish Round Robin (SRR)?
A method that gives beter service to processes that have been executing for a while Processes in the ready list are split into two lists new and accepted New processes wait while accepted processes are serviced When the priority of a new process reaches that of an accepted process that new process becomes accepted
40
Explain rates in SRR?
The priority of a new process will increase by at a rate a The priority of an accepted process will increase by a rate b Both a and b are parameters and can be adjusted to tune the method
41
How can CPU scheduling become more complex?
when multiple CPUs are available such as: * Homogeneous processors * Symmetric multiproccessing – load sharing * Asymmetric multiprocessing – only one processor accesses system data structures, no need for data sharing