Chapter 3 Quizlet Flashcards
OS application management execution
- Resources are made available to multiple applications
- Processor switches between multiple apps so all appear to be running
- Processor and IO devices can be used efficiently
Process elements
- Process
- process control block
Process
- when processor begins to execute the program code, executing entity
- consists of program code, set of data
process control block
- created and managed by OS
- Contains enough info that a running process can be interrupted and resumed later
- Key tool that enables OS to support multiple processes + do multiprocessing
process interruption
- When process is interrupted, current values of program counter + processor registers (context data) are saved in fields of control block and process state is changed to blocked/ready
- OS can put other process in running state and load program counter + context data into processor registers
process control block storage
- Identifier
- state
- priority
- program counter
-memory pointer - context data
- IO status information
- accounting information
identifier
- stored in process control block
- unique, distinguishes it from other processes
state
- stored in process control block
- if a process is running/blocked/ready/suspended, etc
priority
- stored in process control block
- priority level relative to other processes
program counter
- stored in process control block
- address of next instruction in program to be executed
memory pointers
- stored in process control block
- pointers to program code and data associated with this process + any memory blocks shared with other processes
context data
- stored in process control block
- data present in registers in processor while process is executing
I/O status information
- stored in process control block
- includes outstanding I/O requests, I/O devices assigned to the process, list of files in use by process, etc
accounting information
- stored in process control block
- includes amount of processor/clock time, time limits, account numbers, etc
trace of a process
- the sequence of instructions that execute for that process, used to characterized behavior of individual processes
- Processor behavior characterized by how traces of various processes are interleaved
Dispatcher
small program that switches processor from 1 process to another
2 state process model
- process is either in Running or Not Running state
- When OS creates new process, it creates process control block for it and enters process into system in Not Running state
- Process exists, is known to OS, is waiting for opportunity to execute
- At times, currently running process will be interrupted and dispatcher will select other process to run, which moves it into Running state
2 state process model dispatcher behavior
Any interrupted process is transferred to queue of waiting processes by dispatcher
- If process is completed/aborted, it is discarded and exits system via dispatcher
- Dispatcher takes process from queue to execute
Process creation
OS builds data structures used to manage the process and allocates address space in main memory to process
process creation reasons
- new batch job
- interactive logon
- created by OS to provide a service
- spawned by existing process
process spawning
- when OS creates a process at explicit request of another process
- parent process and child process
- related processes usually need to communicate
Process termination
computer system must provide means for a process to indicate its completion
process termination reasons
- normal completion
- time limit exceeded
- memory unavailable
- bounds violation
- arithmetic error
- timer overrun
- IO failure
- invalid instruction
- privileged instruction
- operator/OS intervention
- parent termination
- parent request
5 state process model
- running - currently being executed
- ready - prepared to execute
- blocked/waiting - can’t execute until some event occurs
- new - created process but not yet admitted to pool of executable processes
- exit - process released from pool of executable processes