P2L1 Processes and Process Management Flashcards
What is a Process Control Block?
A PCB is a ____ ______ that the operating system maintains for every one of the ______ that it manages.
A PCB is a data structure that the operating system maintains for every one of the processes that it manages
Each time the swapping between processes is performed the OS performs what we call ______ ______.
Each time the swapping between processes is performed the OS performs what we call context switch.
The PCB data structure is created when ___________________________
and it’s also _______ at that time.
The PCB data structure is created when the process is initially created itself and it’s also initialized at that time.
An example of a field of the PCB that is updated whenever the process state changes is …
…. when a process requests more memory PCB will be updated to reflect to virtual to physical memory mappings
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 …
… 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.
Visual metaphor for a process: ___________________
order of toys
An order of toys (metaphor for process)
- has its ______________
- it requires some ____ ___ a ________ ______ ____
- and even may require some _____ ________
An order of toys has its
- state of execution,
- it requires some parts, and a temporary holding area,
- and even may require some special hardware.
A process encapsulates all of the _____ of a running application.
A process encapsulates all of the state of a running application.
A process encapsulates all of the state of a running application. This includes
A process encapsulates all of the state of a running application. This includes
- the code,
- the data,
- all the variables that that application needs to allocate.
An OS abstraction used to encapsulate all of the process state is an …
An OS abstraction used to encapsulate all of the process state is an address space.
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 ______.
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.
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 _____
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
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.
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
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?
Both P1 and P2 can have the exact same virtual address space range
Fork or Exec?
- copies the parent’s PCB
- both child and parent continue execution at instruction after fork/exec
- replaces the child image
- initializes the PCB
- starts from the first instruction
- fork
- fork
- exec
- exec
- exec