Processes Flashcards

1
Q

3 major aspects of a process

A
  1. State of execution (program counter, stack)
  2. State data in memory (state data in register)
  3. Might require specialized hardware (I/O devices)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is a process made?

A

An application is stored on disk. When it gets launched, its binary gets executed and placed into main memory (in ready state) and becomes a “process” - an active entity
A process can be viewed as an “execution state” of an active application

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

What are the parts of a process?

A

All parts are uniquely identified by its address space or stack. Parts of the stack are text = static code, data = global vars set at initialization, heap, and stack (which dynamically changes via LIFO during execution)

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

What are page tables used for?

A
  • converts virtual addresses in stack and maps it to physical addresses in main memory (DRAM)
  • this makes physical memory management simpler
  • O/S dynamically sets page tables and will not assign a 1:1 mapping to save physical memory. O/S may also swap parts of a process to disk space when context switching
  • also lists what accesses are allowed for a given user
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What data structure(s) does the O/S use to know what a process is doing at any given time?

A

Process Control Block
There are several bits of info (in PCB) to keep track. A couple of important items are Program Counter (and CPU registers), Stack Pointer, list of open files, page table, execution time of process, process priority, max memory usage and more.
Stack pointer is maintained in DRAM memory. Stack pointer points to top of process stack.

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

What does CPU use to keep track of where a process is during execution

A

+ Program Counter
Program counter is maintained on CPU. There are also other registers on CPU that keep track of addresses for status information, argument values. All these are part of the state of a process.
The program counter is updated on PCB only for a context change.

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

What is a Context Switch?

What are the costs of a Context Switch?

A

When O/S changes from scheduling a process to another process. All state must be saved to the PCB for the first process, then all state for new process from its PCB is initialized to CPU registers.
Costs of context switch are:
- direct costs - the number of cycles to load and store all values of PCB to and from memory
- indirect costs - the changing of data on the different levels on CPU cache

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

What is hot and cold cache?

A

Hot cache - cache hits - is correctly accessing data it is is seeking in the cache
Cold cache - cache misses - when cache is empty or irrelevant data is in the cache

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

What are the 3 different cache misses?

A
  1. Compulsory - at beginning of process, the first access to a PCB, the PCB data must be brought into the cache
  2. Capacity - when PCB data exceeds the capacity of the cache and blocks are trashed from the cache
  3. Conflict - when several PCB blocks are mapped to same block frame. also called collision or interference misses
How well did you know this?
1
Not at all
2
3
4
5
Perfectly