Interrupts and Scheduling Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an interrupt?

A

Interrupts are signals generated by software or hardware to indicate to the processor that a process needs attention.

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

Different types of interrupts have different…

A

priorities and how urgent they are must be taken into account by the operating system when allocating processor time.

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

How are interrupts evaluated?

A

Interrupts are stored in order of their priority within an abstract data structure called a priority queue in a special register known as an interrupt register. It is the job of the operating system to ensure interrupts are serviced fairly by the processor through the Interrupt Service Routine (ISR).

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

Describe the mechanics of the Interrupt Service Routine.

A

The processor checks the contents of the interrupt register at the end of each Fetch-Decode-Execute cycle. If an interrupt exists that is of a higher priority to the process being executed, the current contents of the special purpose registers in the CPU are temporarily transferred into a stack. The processor then responds to the interrupt by loading the appropriate ISR into RAM. A flag is set to signal the ISR has begun. Once the interrupt has been serviced, the flag is reset. The interrupt queue is checked again for further interrupts of a higher priority to the process that was originally being executed.

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

What does ISR stands for?

A

Interrupt Service Routine

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

How does the OS manages the execution of different programs?

A

The OS implements various scheduling algorithms that, albeit working in different ways, ensure all sections of programs being run (known as ‘jobs’) receive a fair amount of processing time.

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

What are the 2 types of scheduling algorithms?

A

Pre-emptive and non pre-emptive algorithms

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

What are some examples of pre-emptive algorithms?

A

Multilevel Feedback Queues, Shortest Remaining Time, Round Robin

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

What are some examples of non pre-emptive algorithms?

A

First Come First Served, Shortest
Job First

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

What are the characteristics of pre-emptive algorithms?

A

Jobs are actively made to start and stop by the OS.

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

What are the characteristics of non pre-emptive algorithms?

A

Once a job is started, it is left alone until it is completed.

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

Describe the mechanics of the Round robin algorithm.

A

Each job is given a fixed section of processor time - known as a time slice - within which it is allowed to execute. Once each job in the queue has used its first time slice, the operating system again grants each job an equal slice of processor time. This continues until a job has been completed, at which point it is removed from the queue.

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

What are the advantages of the Round Robin algorithm?

A

Round Robin ensures each job is seen to.

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

What are the disadvantages of the Round Robin algorithm?

A
  1. Longer jobs will take a much longer time for completion due to their execution being inefficiently split up into multiple cycles.
  2. This algorithm also does not take into account job priority
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Describe the mechanics of First come first served algorithm.

A

Jobs are processed in chronological order by which they entered the queue.

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

What are the advantages of the First come first served algorithm?

A

It is straightforward to implement.

17
Q

What are the disadvantages of the First come first served algorithm?

A

Does not allocate processor time based on priority.

18
Q

Describe the mechanics of Multilevel feedback queues algorithm.

A

This makes use of multiple queues of different priority levels, each which is ordered based on a different priority.

19
Q

What are the advantages of the Multilevel feedback queues algorithm?

A

Takes into account priority of jobs to be executed.

20
Q

What are the disadvantages of the Multilevel feedback queues algorithm?

A

This can be difficult to implement due to deciding which job to prioritize based on a combination of priorities.

21
Q

What is processor starvation?

A

When a particular process does not receive enough time in order to be executed and completed.

22
Q

Describe the mechanics of the Shortest job first algorithm

A

The queue storing jobs to be processed is ordered according to the time required for completion, with the longest jobs being serviced at the end. The time of completion is measured in FDE cycles

23
Q

What are the advantages of the Shortest job first algorithm?

A

This type of scheduling is most suited to batch systems, where shorter jobs are given preference to minimise waiting time.

24
Q

What are the disadvantages of the Shortest job first algorithm?

A
  1. It requires the processor to know or calculate how long each job will take and this is not always possible.
  2. There is also a risk of processor starvation if short jobs continue being added to the job queue.
25
Q

Describe the mechanics of the Shortest remaining time algorithm.

A

The queue storing jobs to be processed is ordered according to the time left for completion, with the jobs with the least time to completion being serviced first. If a job with a smaller time to completion is added while a job is being completed, the scheduler is switched to that one.

26
Q

What are the disadvantages of using the shortest remaining time algorithm?

A

There is a risk of processor starvation for longer jobs if short jobs are added to the job queue.

27
Q

What are the advantages of using the shortest remaining time algorithm?

A

The priority of jobs is taken into account.

28
Q

What is a scheduler?

A

A scheduler is part of the OS that uses a scheduling algorithm to determine how to share processor time

29
Q

The data structure used to handle interrupts is a:

A

stack