Chapter 3 - Intro (mine) Flashcards
What is a container?
Basically lightweight VM.
- lightweight, isolated environment
- houses an application and has all of the things it needs to run (dependencies)
- shares the host’s OS kernel.
Think of a shipping container with you + all your stuff in it. It has everything you need to function. You’ll share the ship’s resources - bathroom, engine, deck, etc.
What is a process?
A running program
What does the OS do to create a process?
It creates a new address space and a virtual processor to execute the process.
How does an OS keep track of its processes?
Keeps track of the processes/ virtual processors in a process table.
What’s a process control block?
A data structure that contains info about the proccess - ID, state, control.
(It has stuff like machine code, memory allocation (data, stack, heap), resources (e.g., files, devices), processor context (e.g., registers, memory addresses))
What is process context?
Represents the state of the process = CPU register values, memory maps, open files, accounting information, privileges, etc.
What is context switching?
Switching between processes by saving and reloading contexts (involves the OS)
Switching between threads by saving and reloading contexts (share addr space, so independent of OS)
Process: +ves and -ves
Independent/ strong isolation; but heavyweight /need new addr space
What is a thread?
- A piece of code that executes independently of other threads
- There’s no attempt to get concurrency transparency
What’s contained in a thread context?
Processor context + minimal info for thread mgmt
Threads vs. Processes
Performance vs. isolation:
- Threads have better performance (fast to create, fast to context switch)
- Isolation is left entirely to developers (threads can access shared data in the process)