Mini test 2 Flashcards
(42 cards)
Processes
an instance of a running program
functionality of Processes
provides logical control flow and private address space
management of Processes
OS uses context switching and virtual memory
purpose of fork
creates a new child process
behavior of forking
returns twice: once in the parent (child’s PID) and once in the child (0)
characteristics of forking
child gets a copy of the parent’s address space and file descriptors
exec function
replaces the current process memory with a new program
exec usage
execve is a common variant that loads and runs a program
details of exec
maintains PID but overwrites memory, stack, and code
Process Graphs
visualize the partial ordering of operations in concurrent programs
features of Process Graphs
nodes represent operations; edges indicate execution order
Zombies
processes that have completed execution but still have an entry in the process table
cause of Zombies
occur when a parent process doesn’t immediately perform a wait to collect the child’s termination status
resolution of Zombies
parent performs reaping using wait or waitpid
functionality of wait
pauses the parent until any child terminates; reaps zombie processes
functionality of waitpid
more specific that wait, can wait for a specific process
wait/waitpid options
can use various flags to modify behavior, such as non-blocking waits
Signals
notifications sent to a process by the OS indication that an event has occurred
types of Signals
identified by integer IDs, like SIGINT for interrupt and SIGKILL for termination
behavior of Signals
can be ignore, terminate the process, or be caught by a custom handler
Traps
intentional, such as system calls of breakpoints; control returns to next instruction
Faults
unintentional but can be recoverable; may re-execute the faulting instruction
Aborts
unintentional and unrecoverable; leads to program termination
Signal Handlers
custom functions defined by a program to respond to specific signals