Last Updated: June 6, 2026
A thread is a unit of work the JVM can run alongside other units. The previous lesson established what a thread is and why a checkout flow benefits from running things in parallel: send the confirmation email, refresh the recommendation cache, and write the order to the database without blocking the user. This lesson covers the mechanics of creating one. There are three classic ways to spawn a thread, plus a modern builder added in Java 21. This lesson walks through each, compares them, names the threads, and shows small e-commerce patterns that kick off a background task without freezing the main flow.
This lesson does not cover what the thread does once it starts running. The scope ends right after the thread begins executing.