Skip to content
Veltoryx Technologies
ProLesson 9.1Intermediate3 min readUpdated 30 October 2026

Processes vs threads

What a thread is, how it differs from a process, what threads share, and why concurrency makes programs faster and harder.

Your computer runs many things at once: a browser, a music player, an editor. Inside one Java program, many things can happen at once too: a web server handles hundreds of requests at the same time. That's concurrency, and the unit that does the work is a thread.

01Process vs thread

  • A process is a running program, with its own memory. Your Java application is one process (one JVM).
  • A thread is a path of execution inside a process. A process can have many threads, and they share the same memory (the heap).
text
JVM process
├── Heap (shared by all threads): objects, static fields
├── Thread "main"      → its own stack: local variables, method calls
├── Thread "worker-1"  → its own stack
└── Thread "worker-2"  → its own stack
ProcessThread
MemorySeparateShared heap, own stack
Cost to createHighLower (very low for virtual threads)
CommunicationPipes, sockets, filesShared objects (fast, but risky)
A crash affectsOnly that processCan bring down the whole process

Loading the rest of the lesson…