Processes, LDEs & Threads Flashcards
(71 cards)
What is the virtualization of the CPU a motivation for?
Threads & processes
Time sharing
Running one program for a little while, then running another one, and so forth
What illusion does time sharing promote?
The illusion that many virtual CPUs exist
What is the consequence of time sharing promoting the illusion that many virtual CPUs exist?
Each program believes that it is using the CPU alone
Program/Executable file
A static entity stored on disk
Process
Active object that’s an abstraction of the CPU / A running program
What initiates a process?
Users / the system
⭐️ A program becomes a process when…
it is selected to execute, loaded into memory & has address space generated for it
Loading
Takes on-disk program and reads it into the address space of process
⭐️ What does a process consist of?
Address space that consists of:
Trampoline
Trapframe
Heap
Stack
Code
Data
Registers: PC, general purpose, stack pointer
What does the address space that a process consists of contain?
Memory that the process can address
What does the trampoline and trapframe that a process consists of do?
Implement transition in & out of kernel space. enable access to privileged kernel services from the user space
⭐️ What does the stack that a process consists of contain?
Temporary data
⭐️ What do the registers that a process consists of contain?
Program Counter, general purpose & stack pointer
Program Counter (PC)
Tells us which instruction the program will execute next
Stack pointer
Manage the stack for function parameters, local variables and return addresses
⭐️ What does the data that a process consists of contain?
Global variables
⭐️ What does the heap that a process consists of contain?
Dynamically allocated structures
Where is relevant information for a process stored?
Process Control Block (PCB)
What are the three most important things stored about a process in a PCB?
Process ID
State
Parent process
⭐️ What are the different process states?
READY
RUNNING
BLOCKED
ZOMBIE
⭐️ READY
The state a process is in when it’s ready to run and pending for running
⭐️ RUNNING
The state a process is in when it’s being executed by the OS, and using the CPU
⭐️ BLOCKED
The state a process is in when it’s suspended due to other events, e.g. IO request