The start() Method: Launching a Thread
What you'll learn: How start() actually creates a new thread of execution and why it's different from directly calling run().
The Core Idea
When you create a Thread object, you've simply constructed a Java object in memory—no actual concurrent execution has begun. To launch the thread and have it run independently, you must call the start() method. This method does two critical things:
-
Allocates OS resources: It requests a new native thread from the operating system, which involves setting up a call stack, program counter, and other low-level resources needed for independent execution.
-
Invokes
run()in the new thread: Once the OS thread is ready, the JVM automatically calls your thread'srun()method in that new thread of execution, not in the calling thread.
Why Not Just Call run() Directly?
If you call run() directly on a Thread object, it executes like any ordinary method—synchronously in the current thread. No new thread is created, and no concurrency happens. You've just made a regular method call.
Thread t = new Thread(() -> System.out.println("Task running"));
t.start(); // Correct: launches new thread, runs task concurrently
// t.run(); // Wrong: runs task in current thread, no concurrency
The Analogy
Think of Thread as a job application and start() as submitting it to an employer. Creating the thread is filling out the paperwork; calling start() actually submits it and gets someone (the OS) to assign a worker (native thread) to execute the job.
Key Takeaway: The start() method is the gateway to concurrency—it allocates operating system resources and schedules your run() method to execute in a separate thread, enabling true parallel execution.