Lecture 11 Flashcards

1
Q

Whats the objective of multi programming?

A

The objective of multiprogramming is to have some process running at all times, to maximize CPU utilization.

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

What’s the idea of multi-programming?

A
  1. Several processes are kept in memory at one time.
  2. When one process has to wait, the operating system takes the CPU away from that process and gives the CPU to another process.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What happens on a multi-core system?

A

On a multicore system, this concept of keeping the CPU busy is extended to all processing cores on the system.

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

What are the states of process execution?

A

Process execution consists of a cycle of CPU execution(CPU burst) and I/O wait(I/O burst)

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

How does a CPU schedular work?

A
  1. Whenever the CPU becomes idle, the CPU scheduler selects one of the processes in the ready queue to be executed.
  2. It then allocates the CPU to that process.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The records in the queues are generally ___________ of the processes.

A

Process Control Blocks

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

What are the four circumstances in which the CPU scheduling decisions take place?

A
  1. When a process switches from the running state to the waiting state
  2. When a process switches from the running state to the ready state
  3. When a process switches from the waiting state to the ready state
  4. When a process terminates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What’s a non-preemptive scheme?

A

Under non-preemptive scheduling, once the CPU has been allocated to a process, the process keeps the CPU until it releases it either by terminating or by switching to the waiting state.

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

Preemptive scheduling can result in ________ when data are shared among several processes.

A

race conditions

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

What is a dispatcher?

A

The dispatcher is a module that gives control of the CPU’s core to the process selected by the CPU scheduler.

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

What is dispatch latency?

A

The time it takes for the dispatcher to stop one process and start another running is known as the dispatch latency.

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

What functions are performed by a dispatcher?

A

This function involves the following:
1. Switching context from one process to another
2. Switching to user mode
3. Jumping to the proper location in the user program to resume that program

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

What are the criteria for comparing CPU- scheduling algorithms?

A
  1. CPU utilization(maximizing)
  2. Throughput(maximizing)
  3. Turnaround time(minimizing)
  4. Waiting time(minimizing)
  5. Response time(minimizing)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Discuss the FCFS algorithms of CPU scheduling.

A

Objective:
-The process that requests the CPU first is allocated the CPU first.
Implementation:
It is implemented with a FIFO queue.
1. When a process enters the ready queue, its PCB is linked to the tail of the queue.
2. When the CPU is free, it is allocated to the process at the head of the queue.
3. The running process is then removed from the queue.

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

What is the disadvantage of the FCFS policy?

A

The average waiting time under the FCFS policy is often quite long.

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

Discuss the shortest-job-first scheduling algorithm.

A

Objective:
It associates with each process the length of the process’s next CPU burst.
Implementation:
1. When the CPU is available, it is assigned to the process that has the smallest next CPU burst.
2. If the next CPU bursts of two processes are the same, FCFS scheduling is used to break the tie.
3. Note that a more appropriate term for this scheduling method would be the shortest-next-CPU-burst algorithm because scheduling depends on the length of the next CPU burst of a process, rather than its total length.

17
Q

What is the disadvantage of the SJF algorithm?

A

Although the SJF algorithm is optimal, it cannot be implemented at the level of CPU scheduling, as there is no way to know the length of the next CPU burst.

18
Q

How can we approximate SJF scheduling?

A

We may not know the exact length of the next CPU burst but we can predict its value. We expect the next CPU burst to be similar in length to the previous ones and then pick the process with the shortest predicted CPU burst.

19
Q

Preemptive scheduling is sometimes called ____________

A

shortest-remaining-time-first scheduling.