A process is an instance of a program being executed by an OS.
The OS manages the processes in something called a Process Control Block (PCB). This helps it keep track of what is running, how much memory is being used and where, the program being run, the current instruction address, etc.
Your operating system as a series of processes that are running, and each application you run is a process.
Since the PCB is created when a program runs, if you are running multiple copies of the same program, multiple PCBs can therefore be running the same program. Some applications will not allow this however, and they only allow a single instance of them to run.
A process can be thought of as a Finite State Machine (FSM). That is, it can exist in only one of three states at any given time.
- running – the CPU is actively running this process
- ready-wait – in this state, the process has the necessary resources to run, but it cannot run yet due to it’s time to execute not being ready.
- blocked – in this state, there is something blocking an execution of the process. Maybe it is waiting on IO, maybe it doesn’t have enough RAM to execute
There are three additional states that are available for the PCB to be in.
- new – the process has been started but isn’t allowed to run yet.
- terminated – the process is no longer running, and all of it’s resources are being returned to the system before the PCB is deleted
- suspended – There are enough resources, but the OS can halt the running of the process.
Switching Between Processes
A context switch is the transfer of control from one process to another.
Every time a process stops executing to allow another one to resume, the OS must save all information about the stopped process. This information is restored when the process again gets a chance to run. This interruption is transparent to the process, occurs quickly, and hopefully in a manner that the user doesn’t tell.
Virtual CPUs
Each process gets a virtual CPU. It looks like a CPU, and acts like one, but it is an abstraction of the CPU.
The idea of virtual CPUs allows for processes to move between single and multiple processor systems easily.
Processes was originally found on Access 2 Learn