OS Topic 9 - Processes and scheduling Flashcards

1
Q

The ability of an operating system to run more than one program at a time is known as m________________

A

multitasking

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

Processes are concurrent if their lifetimes o______, even if that happens because a single processor rapidly switches execution between different processes so they are never r_______ at the same instant.

A

overlap
running

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

Of course, with multiple cores, processes can be running at the same instant, and we could then use the technical term p________

A

parallel

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

The issues for the OS for concurrent and true parallel processes are the s______, so OSs must be designed for the more g______ case of concurrent processes.

A

same
general

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

The issues for the OS for concurrent and true parallel processes are the same. What are some of the issues?

A

In both cases, there could be contention for the same resources: shared files, I/O devices and memory.

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

Most operating systems provide an alternative to the process. This alternative is called a t________.

A

thread

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

A thread represents a separate execution of a program, just as a process does, but threads share the m_______ and other r___________ allocated to a single process. This means that the program can be structured as two or more tasks that are being executed apparently at the same time and that share the same data.

A

memory
resources

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

An advantage of threads over processes is that, because they share memory and other resources, the operating system can create them more q_________ and switch between them more q__________.

A

quickly
quickly

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

True or False?

Each process is an independent entity.

A

True

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

Task Manager

The number of active tasks will vary according to what software you are running.

Each one has a unique PID.
What does PID stand for?

A

process identifier

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

Task Manager

RSS: the amount of physical memory currently used. What does RSS stand for?

A

(resident set size)

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

Task Manager

What does VM-Size stand for?

A

(virtual memory size) the total amount of memory used by the process

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

Task Manager

What does User mean?

A

name of process user

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

Task Manager

What is ‘State’

A

process state, shown as a variety of letters

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

Task Manager

What is ‘Prio’

A

process priority

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

Task Manager

What does PPID stand for?

A

parent process identifier.

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

Scheduling

One of the key tasks for an operating system is to manage d_____ on the p______, allocating appropriate processor time to different applications and to the operating system itself.

A

demand on the processor

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

Scheduling

The central problem is choosing which process to r_____ n______ and for h___ l____; this is known as scheduling.

A

run next
how long

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

Scheduling

Switches between processes need to happen many times a second to give the user the illusion of m_______________.

A

multitasking

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

Scheduling

Each process is allowed to run only for a short time-slice, often referred to as a q_______, for example 10 ms.

A

a quantum

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

Scheduling

A process that is replaced by another when its quantum expires is said to have been p___-e_______.

A

pre-empted

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

Scheduling

Frequent switching is particularly needed for an OS described as a real-time operating system.

What is meant by a real-time operating system?

A

This is a claim that it can respond to events ‘in real time’, something particularly important when software controls equipment.

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

Scheduling

Why is frequent switching important in a real-time operating system that we might see in equipment such as smart-devices in cars?

A

It would be disastrous for example if the computer system of an autonomous car stopped controlling the steering while the processor was busy calculating the best route.

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

Scheduling

Real-time must be specified in terms of time take to note an event, and time taken to deal with an event.

What is the maximum amount of time a real-time OS can take to identify an event?

What is the maximum amount of time that a real-time OS can take to handle the event?

A

10ms
50ms

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

Scheduling

Why don’t mainstream OSs have to offer such strong guarantees like real-time OS’s?

A

Because most processes are not time-critical and the consequences of failure are less severe.

26
Q

What does FIFO stand for?

A

First in First Out

27
Q

If there are four processes lined in order A, B, C, D list the order of execution in FIFO.

A

A, B, C, D

28
Q

How would Round Robin scheduling work on 4 tasks called A, B, C, D?

A

A for a quantum, B for a quantum, C for a quantum, D for a quantum. Repeat until all processes have finished.

29
Q

How does FIFO do on fairness?

A

Not well, some processes may take a lot longer than others.

30
Q

How does Round Robin do on fairness?

A

Well, all processes get an equal time.

31
Q

What does it mean when we say a process is ‘starved’?

A

The process is ready to run but never gets a chance.

32
Q

Priority

An alternative strategy is to give each process a priority level, usually expressed as a small number, for example 0 to _____.

A

100

33
Q

Priority

The queue of ready processes is kept as a priority queue: the head of the queue always has the __________ priority

A

highest

34
Q

Priority

When a new high-priority process joins a queue, it ‘q_______ j________’ over lower-priority processes so that the queue is always kept in order of priority.

A

queue jumps

35
Q

Priority

Is Priority Scheduling fair?

A

It can be unfair: a low-priority process may never get a turn.

36
Q

Priority Classes

A variant is to classify processes into a number of classes of priority and keep a q_______ for each class.

A

queue

37
Q

Priority Classes

Let’s say we had two classes, high priority and low priority.
There may be several process in each class,
e.g.

High - DD
CCC

Low - B
AAAA

What letters are in the queue for the high priority class?

A

DD
CCC

38
Q

Priority Classes

Let’s say we had two classes, high priority and low priority.
There may be several process in each class,
e.g.

High - DD
CCC

Low - B
AAAA

What letters are in the queue for the low priority class?

A

B
AAAA

39
Q

Priority class

For the following classes of priority, what scheduling system can we use for each queue?

High - DD
CCC

Low - B
AAAA

What order would the letters be in?

A

Round Robin

CDCDC ABAAA

40
Q

Dynamic scheduling

Another approach is to change p__________ dynamically.

A

priorities

41
Q

Dynamic scheduling

Dynamic scheduling can avoid ‘s___________’: a low-priority process that is making no progress – because there are always higher-priority processes waiting – can have its p____________ increased temporarily.

A

starvation
priority

42
Q

What does ‘pre-emption’ refer to?

A

“Pre-emption” refers to the ability of an operating system or a scheduler to interrupt the execution of a currently running process or task in order to give control to another process.

43
Q

The Linux scheduling system is based around priority and allows the programmer and user some control. A process priority is given as a number: ___________ numbers indicate higher priority.

A

lower

44
Q

Normal programs start with a priority of ___ (number)

A

20

45
Q

Operating system processes can be given __________ numbers (higher priority).

A

lower

46
Q

There is a mechanism called ‘n_________’ which allows a process to change its own priority or that of another.

A

niceness

47
Q

The final process priority is the initial priority and niceness added together.

If the initial process were 0, and the niceness was 5, what would the final process priority be?

A

5

48
Q

Is a process priority of 5 high priority, normal or low priority?

A

normal

49
Q

What is the highest priority (lowest number) that the root can set the niceness of a priority to?

A

-20

50
Q

What range of priority might you see given that an Initial priority for a user-space process (whether created by a normal user or root) is 20?

For a process started by a normal user?

A

20 - 39
(we can add a ‘niceness’ of 0 - 19)

51
Q

What range of priority might you see given that an Initial priority for a user-space process (whether created by a normal user or root) is 20?

For a process started by root?

A

The root user can change niceness by values from −20 to 19, so final priority will be in the range 0–39.

52
Q

Kernel threads can be given negative priorities so they can be guaranteed to take priority over any user-space processes; these are referred to as r_____-t_______ processes. The highest priority is −_____;

A

real-time processes
-100

53
Q

True or False

Real-time processes do not take priority over other processes.

A

False - they do take priority and are used for kernel operations.

54
Q

Scheduling real-time processes

A real-time process can be scheduled using one of three different schedulers:

FIFO
Round Robin
D____________

A

Deadline

55
Q

Scheduling real-time processes

Deadline. A scheduler that allows the process to b_____ an amount of CPU time needed before a deadline.

A

book

56
Q

Scheduling real-time processes

Deadlines are suited to handling a______ and v_______ in a buffer where processing must be completed in time for the next block of data to arrive.

A

audio and video

57
Q

Scheduling normal processes

The current (2023?) Linux ‘normal’ scheduler is called the C_______ F______ S___________.

A

The Completely Fair Scheduler

58
Q

The Completely Fair Scheduler honours the initial priority and niceness values but a_______ p_______ d_______ so that all processes get a ‘fair’ slice of CPU time.

A

adjusts priority dynamically

59
Q

What is ‘idle’ process which is found in most OSs and created when the system boots?

A

The sole purpose of the system idle process is to run when the processor has nothing else to do. Having such a process simplifies the design of the operating system since it can always find at least one process to run.

60
Q
A