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
process exit stages
- Process terminated when it reaches natural completion, aborts due to unrecoverable error, or when another process with authority causes it to abort
- Process no longer eligible for execution
- Information associated with job temporarily preserved by OS so support/auxiliary programs can extract needed info
process dispatching priority
convenient to have multiple ready queues for different priority levels
suspended process
- Processor can be idle when all no processes are in ready state (Can’t easily increase memory capacity)
- processes can be stored in secondary storage to make room for new/previously suspended process
- useful in detecting security threats and debugging software
Swapping
- moving part/all of a process from main memory to disk
- When no processes in main memory are in Ready state, OS puts a blocked process into suspend state and swaps it out to disk into a suspend queue
suspend queue
queue of existing processes that have been temporarily removed from main memory
Suspended process characteristics
- Process not immediately available for execution
- Process may/may not be waiting on an event
- Process placed in suspended state by an agent (itself, parent process, OS) for purpose of preventing its execution
- Process may not be removed from this state until agent explicit orders its removal
process suspension reasons
- swapping
- other OS reason - background/utility process/problem causing process
- interactive user request
- timing
parent process request
OS control structures
- OS constructs and maintains information tables about each entity it manages
- memory tables
- IO tables
- file tables
- process tables