Life of a Process
Program vs Process
- Programs -> The applications that we can un.
- Processes -> Programs that are running.
Process Creation and Termination
Windows
boot -> smss.exe -> winlogon.exe -> csrss.exe
Linux
in Linux, processes have a parent child relationship.
all processes come from a process.
the initial process is init
Managing Process
Windows
linux
- ps -x
- ps -ef
- /proc -> stores files corresponds to running processes
Signals
a way to tell a process that something's just happened
Windows & Linux
- SIGINT -> signal interrupt CTRL + C
Managing Processes
Windows
- Process Explorer -> a utility Microsoft created to let users look at running processes.
Linux
- kill -> sends SIGTERM
- kill -KILL -> sends SIGKILL
- kill -TSTP -> sends SIGTSTP (terminal stop)
- kill -CONT -> sends SIGCONT (continue)
- SIGTERM -> give process time to clean up before die
- SIGKILL -> kill process without giving it time to clean up.
- SIGTSTP -> put a process in a suspended state
- SIGCONT -> resume suspeneded process
Process Utilization
Resource Monitoring
Windows
Linux
- top -> shows the top processes that are using the most resources on machine.
- uptime ->
- lsof => lists open files and what processes are using them.