Week 3 Flashcards

1
Q

What is a process scheduler (allocates CPU time)?

A

Allocates CPU time to various processes

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

What are the 4 Scheduling Algorithms?

A

First Come First Served (FCFS)

Round Robin (RR)

Shortest Process Next (SPN)

Multilevel Queueing

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

What is First Come First Served (FCFS)?

A

Processes get executed in order they arrive

Not interrupted until finishes or reaches a wait state

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

What are the Pros and Cons of FCFS?

A

Pros:

Simple and easy to implement

Reduced context switching

Intuitively fair

No starvation

Cons:

Convoy effect - Long waiting time, poor responsiveness

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

What is Round Robin (RR)?

A

allocates each task an equal share of the CPU time

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

What are the pros and cons of RR?

A

Pros:

Fair CPU Allocation

Responsiveness

No starvation

Cons:

Time quantum sensitivity

Context switch overhead

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

What is Shortest Process Next (SPN)?

A

Select the process with the shortest execution time

Non Preemptive - something cannot be taken away or interrupted

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

What are the pros and cons of SPN?

A

Pros:

Better average waiting time

Responsiveness

Cons:

Estimating process execution time

May lead to starvation

Longer processes wait longer

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

What is Multilevel Queueing?

A

a CPU scheduling algorithm

divides a ready queue into multiple smaller queues

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

What is Fixed-Priority Scheduling?

A

High priority queues are executed first

May lead to starvation

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

What is Time Slicing?

A

A time slice for each queue

Eg. 60% for interactive, 30% system, 10% batch

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

What are the pros and cons of Multilevel queueing?

A

Pros:

Supports different performance objectives

Cons:

Complex and difficult to calibrate

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

What is a multi core processor?

A

A multi-core processor has multiple processing units (cores) on a single CPU chip

Each core has its own L1 cache memory

There is a cache hierarchy

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

What is the common queue?

A

When a processor becomes available, it chooses a new process from a common queue

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

What are private queues?

A

When a processor becomes available, it chooses a new process from its private queue

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

What are the 2 methods for efficient Multi-Processor Scheduling?

A

Load Balancing

Processor Affinity

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

What is Load Balancing?

A

Evenly distribute processes among CPU cores

Common ready queues automatically enforce load balancing

18
Q

What is Processor Affinity?

A

Keep a process on the same CPU core(s)

Soft affinity: only move processes if there is a good reason

Private queues automatically enforce processor affinity

19
Q

What is The Linux Scheduler?

A

A multi-queue scheduler

Scheduling domain: a set of CPU cores than can be balanced against each other

Bottom-up Load balancing among domains

Processor affinity - only perform load balancing if there are severe imbalances

20
Q

What is monoprogramming (single, single)?

A

Running a single program at a time within a single address space

21
Q

What is multiprogramming?

A

allows multiple programs to run simultaneously on a single CPU

basic form of parallel processing

22
Q

What are the 3 Memory Management Tasks?

A

Relocation

Protection

Sharing

23
Q

What is Relocation(hint: new location in m)?

A

Moving a process to a new location in memory without disrupting its execution

24
Q

What is Protection?

A

User processes need to be protected from each other

System processes should be protected from user’s processes

25
What is Sharing (processes may)?
Processes may sometimes need to share data
26
What is (Fixed/Static) Partitioning?
Memory is divided into partitions of fixed boundaries (equal or unequal sizes) 1-1 mapping of partitions and processes
27
What are the pros and cons of Fixed Partitioning?
Pros: Easy to understand or implement No external fragmentation Cons: Internal fragmentation Limited by number and size of partitions
28
What is Dynamic Partitioning?
Exact memory allocation - only what is needed Partitions of variable length and number 1-1 mapping Starts well then leads to external fragmentation
29
What is External Fragmentation?
Space is wasted between partitions
30
What is Compaction?
combining all the empty spaces together and processes Fixes external fragmentation
31
What are the pros and cons of Dynamic Partitioning?
Pros: No internal fragmentation More efficient than static partitioning Cons: External fragmentation Overhead of compaction
32
What is Simple Segmentation?
Process divided into segments Segments loaded into memory Segments do not need to be contiguous
33
What are the pros and cons of Simple Segmentation?
Pros: Sharing and Protection Better handling of larger programs No internal fragmentation Cons: External fragmentation (< dynamic)
34
What is Virtual Memory Segmentation?
Segmentation + Virtual memory Segments can be swapped between memory and disk storage OS loads segments into memory as needed
35
What is virtual memory?
Use of disk space to extend main memory; illusion of larger memory but much slower
36
What are the pros and cons of Virtual Memory Segmentation?
Pros: Can fit processes larger than memory Cons: More complex memory management
37
What is Simple Paging?
Memory divided into equal fixed-size frames Process is divided into same-size pages
38
What are the pros and cons of Simple Paging?
Pros: No external fragmentation Simple memory allocation Cons: Small internal fragmentation Page tables can become large
39
What is Virtual Memory Paging?
Paging + Virtual memory Pages loaded into frames as in simple paging, except that not all pages need to be loaded at same time
40
What are the Pros and Cons of Virtual Memory Paging?
Pros: Can fit processes larger than memory Cons: adds complexity (overhead)
41
Protection & Sharing with Segmentation and Paging
Goals: Protection: Each process can only access its own pages/segments Sharing: Multiple processes can access the same page/segment Implementation: Each frame/segment has a number of protection bits specifying read, write, execute permissions, which processes have these permissions Protection/sharing is generally easier with segmentation than with paging since Segment table is smaller than the page table Segments are more natural units for protection/sharing