Skip to main content
To understand the difference between a process and a thread, it helps to view them from the kernel’s perspective. This article explains how the kernel manages virtual memory and tasks, why threads are efficient for shared work, and what risks shared memory introduces. Imagine the machine’s RAM as one continuous bar — for example, 16 GB. The kernel manages that entire bar; user programs never access physical RAM directly. Instead, the kernel creates abstractions (processes and threads) and enforces strict boundaries between them. When you launch an application, the kernel creates a process and assigns it a slice of the virtual address space. The kernel records which slice belongs to which process and enforces isolation: if a process tries to read or write memory outside its assigned slice, the kernel blocks it. This isolation prevents one program from accidentally or maliciously reading or corrupting another program’s data. For example, suppose you open a photo editor on your laptop. The kernel starts a process and hands it a slice of memory; the editor fills part of that slice with a photo (say, 5 MB of pixels). You also have Spotify running: to the kernel, that’s a second process with its own slice. The kernel keeps those two slices separate: Spotify cannot see the photo editor’s memory and vice versa. If Spotify crashes, the photo editor usually continues unaffected.
A stylized diagram of a 16 GB RAM stick showing separate memory slices for different processes, with some slots containing image pixels and others shown as orange blocks. The kernel is highlighted below and icons for a photo editor and Spotify are shown as example processes.
Threads: shared address space, lightweight tasks
  • When the photo editor needs to brighten an image, doing the work on a single core can be slow. The process asks the kernel: “Give me four threads.”
  • The kernel creates four tasks (threads) and points each at the same slice of virtual memory that the photo editor already owns. The kernel then schedules those four tasks onto available CPU cores so they run concurrently.
  • Because all threads share the same address space, they can process different portions of the image in place without copying data. This makes multi-threaded operations fast and memory-efficient.
From the kernel’s point of view, both processes and threads are tasks scheduled on the CPU. The crucial difference is how memory is managed for each new task:
  • Creating a new process gives the task a fresh virtual address space (logically separate). For efficiency, the kernel may use copy-on-write (COW) to delay duplicating physical pages. See Copy-on-Write.
  • Creating a new thread points the new task at an existing address space so memory is shared.
On Linux, both behaviors are implemented by the same low-level primitive: clone(2). Whether the new task shares the creating task’s memory depends on the CLONE_VM flag. The man page provides details: https://man7.org/linux/man-pages/man2/clone.2.html
If you attempted the same brightness operation using four separate processes instead of threads, each process would have its own virtual address space. Unless you explicitly set up shared memory, the photo data would need to be present in each process’s address space. Although the kernel may use COW to avoid immediate physical duplication, logically the memory is separate and duplicated writes would consume more memory and require extra work to reassemble results. Threads avoid that overhead by sharing memory. Shared memory brings performance, but also risk. Because multiple threads can read and write the same memory simultaneously, unsynchronized access can create race conditions. Programs must use locks, mutexes, atomic operations, or other synchronization primitives to ensure consistent state. Additionally, because threads share a single address space, a fault in one thread (for example a segmentation fault) commonly terminates the entire process and all its threads.
A stylized diagram of a 16 GB RAM module with colored blocks representing four separate processes and 5 MB of pixels shown in allocated slots. Below it is a labeled "KERNEL" arrow pointing down toward a Photo Editor (Photoshop) icon.
Threads are lightweight tasks that share a process’s address space; processes have separate address spaces enforced by the kernel. Use threads to avoid copying and to exploit parallel CPU cores, but take care to synchronize shared memory accesses.
Because threads share the same address space, a bug or crash in one thread (such as a segmentation fault) can terminate the whole process. Proper synchronization and error handling are essential.
Comparison summary Further reading and references

Watch Video