Mini test 2 Flashcards
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