Log in Sign up
Back to Discover
💻

Process (computing)

technology Maturity 9-11

A computer program is a list of rules.

Concepts- Program vs. Process vs. Thread.jpg
Concepts- Program vs. Process vs. Thread.jpg
When the computer follows the rules, it is called a process. This is what makes your computer work. It helps you play games or watch music. It can do many things at once. Do you like using a computer?

53 words

A computer program is a list of rules.

Concepts- Program vs. Process vs. Thread.jpg
Concepts- Program vs. Process vs. Thread.jpg
When the computer follows these rules, it is called a process.

One process can use many small parts. These parts work at the same time. This helps the computer do many things.

Your computer can do many tasks at once. It switches between them very fast. This makes it look like they run together.

Sometimes a process must wait. It might wait for you to click a mouse. Then it can start working again.

This keeps the computer busy and fast. It is a very smart way to work.

103 words

A computer program is a list of rules. It stays still on a disk. A process is what happens when the computer follows those rules.

Concepts- Program vs. Process vs. Thread.jpg
Concepts- Program vs. Process vs. Thread.jpg
The computer loads the program into its memory to start the process.

One process can have many small parts called threads. These threads can work at the same time.

Process states.svg
Process states.svg
A process also needs resources to work. These include memory and power from the CPU, which is the computer's brain. The operating system keeps track of these parts in a list. This helps the computer stay safe and reliable.

Most computers use multitasking. This is a way to do many tasks at once. A single CPU core can only do one thing at a time. However, the computer switches between tasks very fast. This is called a context switch. It happens so quickly that it looks like everything is running at once. This is called concurrency.

Htop 3.0.1 screenshot.png
Htop 3.0.1 screenshot.png
Sometimes a process must wait for you to click a mouse. We call this the blocked state. The computer then moves to a new task so it does not sit idle.
KSysGuard 5.22.0 process table screenshot.png
KSysGuard 5.22.0 process table screenshot.png
This keeps the computer fast and busy.

202 words

A computer program is a collection of instructions. These instructions stay still on a disk. A process is what happens when the computer actually runs those instructions.

Concepts- Program vs. Process vs. Thread.jpg
Concepts- Program vs. Process vs. Thread.jpg
When you start a program, it is loaded into the computer's memory. This turns the passive file into an active process. One program can even start many different processes at once. This happens if you open the same app several times. A process is like a living task that takes up time. It needs specific resources to do its job correctly.

To work, a process needs several important things. It needs a copy of its machine code in the memory. It also needs a space called a heap for temporary data. It uses a call stack to keep track of its current events. The operating system gives the process permission to use certain files. These are often called file descriptors in Unix systems. It also needs the processor, or CPU, to follow its instructions. The system keeps track of all this in a process control block.

Process states.svg
Process states.svg

Computers use multitasking to handle many processes at once. A single CPU core can only do one thing at a time. To solve this, the computer uses a trick called concurrency. It performs a context switch to swap between different tasks. This switch happens very fast so it looks like they run together. The computer might switch when a task waits for a user to click a mouse. It can also switch when a task has used its fair share of time. This keeps the processor busy instead of letting it sit idle.

Processes go through different stages while they work. First, a process is created when it is loaded into memory. Then, it enters a waiting state for its turn to run. When the scheduler picks it, the state changes to running. If the process must wait for a file, it enters a blocked state.

Htop 3.0.1 screenshot.png
Htop 3.0.1 screenshot.png
Once the work is done, the process is terminated. The operating system then removes it from the main memory. This cycle allows the computer to manage many jobs safely.
KSysGuard 5.22.0 process table screenshot.png
KSysGuard 5.22.0 process table screenshot.png

This way of working started many years ago. In the early 1960s, software was just for controlling computers. As computers got faster, multiprogramming became very important. This meant running several programs at once to save time. Later, new ideas like time-sharing and networks changed everything. These changes led to the multitasking we use today. You can see this in action when you move a mouse. The computer gives high priority to your movements so they feel instant. This is why your music or video plays smoothly while you work.

451 words

In the world of computing, a process is the active instance of a computer program being executed. While a program is a passive collection of instructions stored on a disk, a process is the living execution of those instructions once they are loaded into memory. A single program can result in multiple processes; for example, opening several instances of the same application creates distinct processes. Processes are the fundamental units of work in an operating system (OS). They require specific system resources, permissions, and data structures to initiate and coordinate their activities.

Concepts- Program vs. Process vs. Thread.jpg
Concepts- Program vs. Process vs. Thread.jpg

To function, a process must own several specific resources managed by the operating system. It holds an image of its executable machine code within a region of virtual memory. This memory includes process-specific input and output data, a call stack to track active subroutines, and a heap for intermediate computation data. The process also utilizes operating system descriptors, such as file descriptors in Unix or handles in Windows, to manage data sources and sinks. Furthermore, the process maintains a processor state, or context, which includes the contents of registers and physical memory addressing. The OS tracks this vital information using data structures called process control blocks.

Process states.svg
Process states.svg

Modern operating systems manage multiple processes through a method called multitasking. A single CPU core can only execute one process at a time. However, multitasking allows the processor to switch between tasks without waiting for each one to finish. This capability is known as preemption. Preemption is vital for interactive tasks, such as moving a mouse or pressing a key, which are given higher priority than CPU-bound tasks. Applications like music or video playback also receive real-time priority to ensure smooth performance. Through rapid context switches, the system creates concurrency, making it appear as though many processes are running simultaneously.

Htop 3.0.1 screenshot.png
Htop 3.0.1 screenshot.png

An operating system scheduler decides exactly when these switches occur. A switch might happen when a task waits for input/output operations or when a task voluntarily yields the CPU. It can also occur due to hardware interrupts or when a scheduler, such as the Linux kernel's Completely Fair Scheduler, decides a process has used its fair share of time. In time-sharing systems, this interleaving of processes and threads allows for efficient resource use. This system ensures that the CPU remains busy rather than sitting idle while a program waits for a slow device, like a printer.

KSysGuard 5.22.0 process table screenshot.png
KSysGuard 5.22.0 process table screenshot.png

Every process moves through a specific lifecycle of states. First, a process is "created" when it is loaded from secondary storage, like a hard disk, into main memory. The scheduler then assigns it a "waiting" state while it awaits a context switch. When the scheduler loads the process into the processor, its state changes to "running." If the process must wait for a resource, such as a file to open, it enters a "blocked" state. Once the resource is available, it returns to the waiting state. Finally, once execution is complete or the OS terminates it, the process enters a "terminated" state before being removed from memory.

Because processes often need to work together, operating systems provide mechanisms for inter-process communication (IPC). Processes can communicate by sharing parts of their address spaces or using specific protocols. For instance, in a shell pipeline, the output of one process passes directly to the next. In more complex distributed computing, processes on different machines might use the Message Passing Interface (MPI) to synchronize. This communication is strictly mediated and controlled by the OS to ensure security and reliability. This prevents independent processes from interfering with one another, which helps avoid system failures like deadlock or thrashing.

The history of process management reflects the evolution of computer speed and efficiency. In the early 1960s, software evolved from simple monitor control to executive control. As computers became faster, multiprogramming became necessary to utilize hardware that was neither cheap nor fully utilized. Initially, multiprogramming involved serial concurrency on uniprocessor architectures. As systems moved toward multiple processors, programs could run in true parallel. The transition from simple multiprogramming to modern multitasking, multiprocessing, and multithreading was driven by the invention of re-entrant code, time-sharing, and computer networks.

697 words
🖼️ Images & Media (4)
File:Concepts- Program vs. Process vs. Thread.jpg
Concepts- Program vs. Process vs. Thread.jpg
File:Htop_3.0.1_screenshot.png
Htop_3.0.1_screenshot.png
File:KSysGuard 5.22.0 process table screenshot.png
KSysGuard 5.22.0 process table screenshot.png
File:Process states.svg
Process states.svg
Up Next
💻
Thread (computing)
Technology
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.