P2L1 Processes and Process Management Flashcards

1
Q

What is a Process Control Block?

A PCB is a ____ ______ that the operating system maintains for every one of the ______ that it manages.

A

A PCB is a data structure that the operating system maintains for every one of the processes that it manages

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

Each time the swapping between processes is performed the OS performs what we call ______ ______.

A

Each time the swapping between processes is performed the OS performs what we call context switch.

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

The PCB data structure is created when ___________________________

and it’s also _______ at that time.

A

The PCB data structure is created when the process is initially created itself and it’s also initialized at that time.

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

An example of a field of the PCB that is updated whenever the process state changes is …

A

…. when a process requests more memory PCB will be updated to reflect to virtual to physical memory mappings

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

During the execution of program the program counter changes on every single instruction.

CPU has a dedicated register to track the program counter (PC)

It is the OS’s job however to …

A

collect and save all the information that the CPU maintains for a process

…. to store it in the PCB structure whenever that particular process is no longer running on the CPU.

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

Visual metaphor for a process: ___________________

A

order of toys

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

An order of toys (metaphor for process)

  1. has its ______________
  2. it requires some ____ ___ a ________ ______ ____
  3. and even may require some _____ ________
A

An order of toys has its

  1. state of execution,
  2. it requires some parts, and a temporary holding area,
  3. and even may require some special hardware.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A process encapsulates all of the _____ of a running application.

A

A process encapsulates all of the state of a running application.

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

A process encapsulates all of the state of a running application. This includes

A

A process encapsulates all of the state of a running application. This includes

  1. the code,
  2. the data,
  3. all the variables that that application needs to allocate.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

An OS abstraction used to encapsulate all of the process state is an …

A

An OS abstraction used to encapsulate all of the process state is an address space.

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

Then during execution, the process dynamically create some state, allocates _____, stores the temporary results, reads data from files. This part of the address space we call a ______.

A

Then during execution, the process dynamically create some state, allocates memory, stores the temporary results, reads data from files. This part of the address space we call a heap.

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

Another very important part of the address space is what we call a ____. It’s a dynamic part of the address space state in that it grows and shrinks during execution, but it does so in a ______ order. Whatever you put on the ____ will be the very_____ to be returned when your trying to read from the _____

A

Another very important part of the address space is what we call a stack. It’s a dynamic part of the address space state in that it grows and shrinks during execution, but it does so in a LIFO (Last In First Out) order.

Whatever you put on the stack will be the very first item to be returned when your trying to read from the stack

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

The memory management hardware and operating system components responsible for memory management, like page tables, maintain a mapping between the ____ addresses and the ____ addresses. By using this kind of mapping, we ____ the layout of the data in the virtual address space.

A

The memory management hardware and operating system components responsible for memory management, like page tables, maintain a mapping between the virtual addresses and the physical addresses. By using this kind of mapping, we decouple the layout of the data in the virtual address space

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

If two processes, P1 and P2, are running at the same time, what are the ranges of their virtual address space that they will have?

A

Both P1 and P2 can have the exact same virtual address space range

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

Fork or Exec?

  1. copies the parent’s PCB
  2. both child and parent continue execution at instruction after fork/exec
  3. replaces the child image
  4. initializes the PCB
  5. starts from the first instruction
A
  1. fork
  2. fork
  3. exec
  4. exec
  5. exec
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe process states:

A
17
Q

A __________________ is a mechanism used by the operating system to switch from the context of one process to the context of another process.

The number of CPU cycles required to load and store a new PCB to and from memory is a _______ cost.

If the data is not in the cache and the CPU has to spend many CPU cycles fetching data from memory, that is an _______ cost

When a process is running on the CPU a lot of its data is stored in the processor cache. Accessing data from cache is very fast (on the order of cycles) relative to accessing data from memory (on the order of hundreds of cycles). When the data we need is present in the cache, we say that the cache is _______ . When a process gets swapped out, all of it’s data is cleared from cache. The next time it is swapped in, we say the cache is _______ .

A

A context switch is a mechanism used by the operating system to switch from the context of one process to the context of another process.

The number of CPU cycles required to load and store a new PCB to and from memory is a direct cost.

If the data is not in the cache and the CPU has to spend many CPU cycles fetching data from memory, that is an indirect cost

When a process is running on the CPU a lot of its data is stored in the processor cache. Accessing data from cache is very fast (on the order of cycles) relative to accessing data from memory (on the order of hundreds of cycles). When the data we need is present in the cache, we say that the cache is hot. When a process gets swapped out, all of it’s data is cleared from cache. The next time it is swapped in, we say the cache is cold.