2026-07-19 15:08

Status:


OS&Y - Module 5 - Process Management

==Life of a Process

  • Programs vs Processes Revisited
    • Programs- the applications that we can run, like the chrome web browser (shameless plug but okay)

    • Processes- Programs that are currently running, several processes can be open for one program at a time, like a bunch of chrome tabs in the chrome web browser

    • A program is just software, but it needs a bunch of hardware resources in order to run, and sometimes they can take more than they are supposed to

    • Whenever you open up a program like a word processor, you start a process

    • That process is then given a process ID in order to correctly identify it from other processes

    • The Kernel makes the decision of what resources to give the given program

    • Background processes, or daemon processes run in the background, they are needed for the operating system to run

  • Windows: Process Creation and Termination
    • The way that processes are created and started depends on the operating system that you use

    • When windows boots up, the first process to start is the Session Manager Subsystem (smss. exe) It basically sets up some stuff for the login to work, and then kicks off the process winlogon.exe

    • Along then with the client server runtime system or csrss.exe, which handles running the windows gui and the command line console

    • In windows, each process needs a parent process in order to be created, this child process inherits a few things from it’s parent process, like vars and settings (called an environment)

    • Windows processes can operate independently from their parent, unlike in linux

    • So, whenever you type in notepad.exe into powershell, powershell is the parent process and notepad is the child process

    • However, if you close powershell, the notepad still runs, not always true for linux

    • You can use taskkill as a command in order to stop a process from running

  • Linux: Process Creation and Termination
    • Processes also have a parent child relationship inside of linux, so, less /etc/some_file | grep Hello basically the grep command would be the child process of the less command

    • The initial Process that all other processes come from is called init and it has a PID of 1

    • It starts up all of the other processes that there is in linux

    • Generally, a process automatically terminates itself, and releases all of it’s given resources

==Managing Processes

  • Windows: Reading Process Information
    • A process is a program in motion, it is the operating system taking the resting code for a program and then running the given instructions it dictates

    • The way to mainly check through process information is by looking inside of the task manager

    • The task manager gives you given information about the processes that are running on the computer, they show you things like the name, ram, cpu usage, and more

    • You can also kill/end tasks via the task manager

    • Task manager can also be used to get the PID of processes by clicking on the Details portion of the task manager tabs

  • Linux: Reading Process Information
    • A lot of it is done through the terminal using the ps command with it’s various given flags. However you can also use built in things like the GUI process monitor, or even htop
    • All things in linux are files, even processes, and therefore you can find all of the processes that are running inside of the /proc folder in the root directory
  • Windows: Signals
    • Signal- a way to tell a process that something’s just happened

    • You can use these to basically tell a process to close in the middle of it running

    • You can generate signals via different keystrokes or other software

    • One of the most common signals is SIGINT which obviously stands for signal interrupt

    • This can be done via control-c inside of any terminal in order to stop the process that is running inside of the terminal

  • Linux: Signals
    • There are LOTS of signals that are sent to processes
    • SIGINT works on linux as well, also generally used via the control-c command
    • There is a bunch of different other key strokes for signals as well
  • Windows: Managing Processes
    • Process Explorer- This is a built in windows tool that lets you do a bunch of different things, like restarting or even pausing given processes
    • It is a utility that was created by Microsoft for IT support Specialists to look at running processes
    • You do have to download it though from the microsoft website
    • It will showcase a lot of information, you can basically right click on it to manage it, like killing it’s processes, it’s child processes, and even more like restarting and what not
    • The GUI does look a little bit wicked but it does look pretty useful
    • Check documentation for more: here.
  • Linux: Managing Processes
    • You can terminate a process using the kill command
    • Originally, with no flags, it sends a SIGTERM signal to the process, which terminates it while still getting it to release some of the resources that it had used
    • Although, it can also be used with SIGKILL, and the -KILL flag, which brutally murders the process while it’s children watch, it gets terminated without reallocation of resources
  • Mobile App Management
    • In mobile applications you cannot see processes that are running, instead you will see a list of applications running instead

    • When a mobile app is running, there will be one or more processes associated with them

    • To manage them, you can check things like the App Switcher inside of IOS, or the app portion of the settings inside of android, it shows a list of apps that you see

    • Basically, to see all the running apps, you can also go to that thing that lets you see which apps you have via the three lines button

    • The OS generally helps to keep track of the processes that are running, and as soon as it can, it will change an app that is not being used into a suspend state to save resources

    • It can also then awake that same app as well

    • Inside of the settings portion of the phone, you can go into the battery life as a means to see what applications might be taking up the most battery if that is an issue

  • Supplemental Readings for Mobile App Management

==Process Utilization

  • Windows: Resource Monitoring
    • You generally want to manage processes when they start fucking some shit up on the operating system
    • You can use the Resource Monitoring tool in order to see how your processes are doing, it gives you a lot of information, like the Total overview of the system, physical graphs of how everything is doing, as well as each process that is running on your computer
    • Each one of the tabs also showcases things like ram usage, and disk usage and more
    • To get this info from the command line, you can use Get-Process
  • Linux: Resource Monitoring
    • OH YEAH BABY, TOP AND H-TOP ARE FINALLY HERE
    • Basically everything that you would know with htop you can apply to this, use it for process management
    • You can also uptime command, which tells you how long your computer has been running for and what not, but I think fastfetch is better
    • You can also use the lsof command in order to see currently open files and what processes are using them

==Glossary

Background processes/Daemon processes: Processes that run or take place in the background

Client/Server runtime subsystem: System that handles running Windows GUI and Command line

Environment: Whatever settings or variables a child process inherits from the parent’s process

Multilingual user interface: Interface that offers and support different languages

Processes: Help the computer run programs 

Process Explorer: A utility Microsoft created to let IT support specialists and system administrators look at running processes

Process ID: Unique identifier for processes on your computer

Programs: The applications that we can run

Resource monitoring: The most common way to quickly take a peek at how system resources are doing

Session manager subsystem: Process that is in charge of setting some stuff up to work for the OS

Signal: A way to tell a process that something has just happened

Suspended apps: A command that will tell the OS to suspend background mobile apps

Task Manager: A Windows utility that allows you to gain information about what tasks you have running in the background 

Termination signal: A kill command that will stop whatever process you tell it to


References