CPU Scheduling Flashcards

1
Q

What is the main objective of CPU scheduling?

A

To introduce CPU scheduling, which is the basis for multiprogrammed operating systems.

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

What are the criteria for evaluating CPU 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
3
Q

What does CPU–I/O Burst Cycle refer to?

A

Process execution consists of a cycle of CPU execution and I/O wait.

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

What is the role of a CPU Scheduler?

A

The short-term scheduler selects from among the processes in the ready queue and allocates the CPU to one of them.

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

When do CPU scheduling decisions take place?

A
  • Switches from running to waiting state
  • Switches from running to ready state
  • Switches from waiting to ready
  • Terminates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between preemptive and nonpreemptive scheduling?

A

Scheduling under switching from running to waiting or terminating is nonpreemptive; all other scheduling is preemptive.

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

What is dispatch latency?

A

Time it takes for the dispatcher to stop one process and start another running.

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

Define CPU utilization in scheduling criteria.

A

Keep the CPU as busy as possible.

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

What is throughput in the context of CPU scheduling?

A

Number of processes that complete their execution per time unit.

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

What is turnaround time?

A

Amount of time to execute a particular process.

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

What is waiting time?

A

Amount of time a process has been waiting in the ready queue.

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

Define response time in CPU scheduling.

A

Amount of time it takes from when a request was submitted until the first response is produced.

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

What is the optimization criteria for scheduling algorithms?

A
  • Max CPU utilization
  • Max throughput
  • Min turnaround time
  • Min waiting time
  • Min response time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe First-Come, First-Served (FCFS) scheduling.

A

Processes are scheduled in the order they arrive.

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

What is the average waiting time for processes in FCFS scheduling?

A

Calculated by averaging the individual waiting times of all processes.

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

What is the convoy effect in CPU scheduling?

A

Occurs when short processes are stuck behind long processes.

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

What is Shortest-Job-First (SJF) scheduling?

A

Schedules the process with the shortest time for its next CPU burst.

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

Why is SJF considered optimal?

A

It gives minimum average waiting time for a given set of processes.

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

How can the length of the next CPU burst be predicted?

A

By estimating it based on previous CPU bursts.

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

What is the preemptive version of SJF called?

A

Shortest-Remaining-Time-First.

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

What is the problem associated with priority scheduling?

A

Starvation, where low priority processes may never execute.

22
Q

What is aging in the context of scheduling?

A

Increasing the priority of a process over time to prevent starvation.

23
Q

Describe Round Robin (RR) scheduling.

A

Each process gets a small unit of CPU time, usually 10-100 milliseconds, before being preempted.

24
Q

What is the performance aspect of Round Robin scheduling?

A

If q is large, it behaves like FIFO; if q is small, it must be large compared to context switch time.

25
What is the average waiting time in priority scheduling?
Calculated based on the priorities assigned to each process.
26
What is the maximum waiting time for a process in Round Robin?
No process waits more than (n-1)q time units.
27
What is the time quantum for the given processes?
4
28
What is the burst time for process P1?
24
29
What is the burst time for process P2?
3
30
What is the burst time for process P3?
3
31
What does the Gantt chart typically indicate compared to SJF?
Higher average turnaround
32
What should be larger compared to context switch time?
q
33
What is the usual range for context switch time?
10ms to 100ms
34
What is the context switch time usually less than?
10 usec
35
What percentage of CPU bursts should be shorter than q?
80%
36
What is a characteristic of a multilevel queue?
Ready queue is partitioned into separate queues
37
What are the types of queues in a multilevel queue?
* Foreground (interactive) * Background (batch)
38
What scheduling algorithm is used for the foreground queue?
RR
39
What scheduling algorithm is used for the background queue?
FCFS
40
What type of scheduling must be done between the queues?
Fixed priority scheduling
41
What is a possibility in multilevel queue scheduling?
Starvation
42
What is a time slice in multilevel queue scheduling?
Each queue gets a certain amount of CPU time
43
What percentage of CPU time is allocated to foreground in RR?
80%
44
What percentage of CPU time is allocated to background in FCFS?
20%
45
What is a defining characteristic of a multilevel feedback queue?
A process can move between the various queues
46
What can be implemented in a multilevel feedback queue to prevent starvation?
Aging
47
What parameters define a multilevel-feedback-queue scheduler?
* Number of queues * Scheduling algorithms for each queue * Method for upgrading a process * Method for demoting a process * Method for determining queue entry
48
What is the time quantum for queue Q0?
8 milliseconds
49
What is the time quantum for queue Q1?
16 milliseconds
50
What scheduling method is used for queue Q2?
FCFS
51
What happens when a job does not finish in Q0 after 8 milliseconds?
It is moved to queue Q1
52
What happens to a job in Q1 if it does not complete in 16 milliseconds?
It is preempted and moved to queue Q2