Virtual Memory Flashcards

Learn about virtual memory

1
Q

Explain the banker’s algorithm

A

Thought experiment, try to give a resource to thread A, then B and check if threads could run without deadlocking, if there is a potential deadlock, put thread B to sleep

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

What is the cause of a deadlock

A

A deadlock occurs when there is a circular dependency of resources between two threads

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

How is an address space defined?

A

It’s the set of memory addresses accessible to a program (for read or write)

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

What is a process in essence?

A

Instance of a running program + one or more threads

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

What is a trap?

A

A kind of interrupt that gives execution control to the kernel.

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

How does the OS protect from errors in user processes?

A

Using a mode bit: 0 is kernel mode and 1 is user mode

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

What syscall is used to allocate space into the heap?

A

The sbrk syscall

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

What hardware is between CPU address references and physical addresses?

A

Memory Management Unit

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

How does the CPU check if a memory reference is valid for a program

A

It uses the base and bound registers and performs hardware aided arithmetic

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