chapter 4 - The Abstraction: The Process Flashcards
What is a process?
Running a program
A process is the execution of a program that includes its machine state and memory compromises.
machine state
What a program can read or update when it is running
The machine state includes all the information needed to resume the program’s execution.
What are ‘memory compromises’ in the context of a process?
Process
What is the role of registers in a process?
They are important for the execution of the process as many instructions explicitly read or update them
stack pointer/frame pointer
manage the stack for a function parameters, local variables and return address
What types of storage do programs often access?
Persistent storage devices
Persistent storage devices include hard drives, SSDs, and other forms of long-term data storage.
What is a register
Registers are small storage locations within the CPU that hold data temporarily
what is the create operation in the process API
creates a new process to run a program when you type a command or open an app
what is the destroy operation in the process API
forcefully kill a process that is no longer needed or is misbehaving
what is the wait operation in the process API
allows a program to wait for another process to finish execution
What does miscellaneous control allow in process management
method to suspend a process (stop it from running for a while) and then resume it (continue it running)
What does the status API do in process management?
Provides information about the process, such as runtime and current state
What must the OS do to run a program as a process?
Load the program’s code and static data into memory (address space)
eager loading
loading process is done all at once before running the program
lazy loading
loading pieces of code or data only as they are needed during program execution
heap
For dynamic memory allocation (e.g., linked lists, hash tables) via malloc().
What does it mean if a process is in the Running state?
It is currently executing instructions on the CPU
Ready state?
ready to run, but the OS has not scheduled it to run at that moment
process is Blocked?
waiting for an event (e.g., I/O) and cannot run until that event completes
zombie process?
A data structure tracking all ready processes and the one currently running
What is register context used for?
It’s used to store the CPU register values of a process when it’s not running