Lecture 7: CPU Scheduling 1 Flashcards

1
Q

Process States: New

A

Process is being created

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

Process States: Running

A

Instructions are being executed

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

Process States: Waiting

A

Process is waiting for some event to occur

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

Process States: Ready

A

Process is waiting to be assigned the CPU

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

Process States: Terminated

A

Process has finished execution

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

One processor → one process running at a time

A
  • All other processers wait for CPU to be free

* Often running process does need CPU (e.g., I/O requests)

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

Multi programming goal: avoid CPU idle times → some

process is using the CPU all the time

A
  • Keep multiple processes in memory at one time
  • When one process has to wait the CPU is allocated to another process
  • Scheduling algorithms: decide which process goes into the CPU
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

CPU (Short-Term) Scheduler:

A
  • first example of resource manager(manages sharing of CPU)
  • applicable to either multiprocessing or multi-threading (we’ll assume former)
  • What? A kernel process that is always active (daemon)
  • responsible for choosing process to run from ready queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When Does the Scheduler Get Invoked?

A
  1. When there’s an interrupt
    • from timer: moves process from running to ready state
    • upon I/O interrupt: moves process from wait to ready state
  2. When running process terminates
  3. When running process issues an I/O request (block) and moves to wait state
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Non-Preemptive:

A

Processes only give up CPU voluntarily
• simpler to implement (no timer interrupts)
• greedy or buggy process can starve others

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

Preemptive:

A

Processes also may be preempted by an interrupt
• adds complexity
• adds protection, better at ensuring fairness, as well as
doing better in other scheduling metrics

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

Throughput:

A

Measured in # processes completed / time unit

Number of processes that complete execution per time unit (Good = High)

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

Turnaround Time:

A

Average (time of completion –time of creation)
- Related metric: Waiting Time (average time on ready queue)
- Waiting vs Turnaround: no penalty for processes w/ long processing times
(Turnaround Time = Processing /Blocked Time + Waiting Time)

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

Response Time:

A

Time of 1st response is produced–time of creation

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

Overhead:

A

Time spent related to scheduling (e.g., context switch time)

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

Fairness:

A

How much variation in waiting time

 a) minimal
 b) proportional (to processing time)
 c) never infinite (aka:  no starvation)
17
Q

CPU Utilization

A

What percentage of time is the CPU doing useful work?

18
Q

Dispatch time:

A

Time it takes to choose next running process including schedule time +
context switch time. If lengthy, effects effectiveness of scheduler

19
Q

First-Come First-Serve (FCFS)

A

Non-Preemptive Policy

+: Easy to implement (ready queue = scheduling queue)
No starvation
–: Convoy Effect: Order of arrival determines performance
e.g., many processes might end up waiting for a big one to get off the CPU
(Food for thought: maybe shortest process should go first instead?)

20
Q

Shortest-Job-First (SJF)

A

Non-Preemptive Policy
Idea: Rank processes by CPU time requests.
Optimizes (minimizes) average waiting time

Preemptive Version of SJF
Idea: Currently running process can be preempted if new process
arrives with shorter remaining CPU burst