P2L1: Processes and Process Management Flashcards
Describe the states in a lifetime of a process?
- New.»_space; ready
- Ready. (scheduler dispatch)»_space; running
- Running.»_space; ready or»_space; terminated or ( I/O or event wait)»_space; waiting
- Waiting. ( I/O or event wait completion)»_space; ready
- terminated
Describe all the steps which take place for a process to transition form a waiting (blocked) state to a running (executing on the CPU) state.
..
What is a process
- instance of an executing program
- State of execution: program counter, stack
- Part and holding area: data, register state
- May require special hardware I/O devices
Diff
- apllication is a program on disk or flash memory (static), process is a state of a program executing when exeuting and loaded in memory (active)
How are processes represented by OS
..
How are multiple concurrent processes managed by OS
..
Elements to describe process state
Elements that are used to describe process state:
- Program counter PC. In what instruction in the binary code (assembly code) it currently is
- CPU register: Stores the PC, address for data or status info
- Stack pointer: Location of top of stack
- process control block: data structure that stores into of PC, registers, scheduling
What are the pros-and-cons of message-based vs. shared-memory-based IPC.
Message
+ OS manages the channel, send/ recv api
- overheads. Copy from address space of P1, to Channel, to P2
Shared memory
+ OS is out of the way, less overhead of OS
- Does not use the OS API, implement code to read and write from this memory
Shared performs better if cost of mapping memory address in processes can be ammotrized between multiple message
Role of the CPU Scheduler
..