In this video, learn the stages of thread execution with an example Java program which demonstrates how to create and start a new child thread and then wait for it to finish executing with the join() method.
- [Instructor] In Java, threads can be … in one of six possible states. … There's the usual new state … for threads that have not yet been started, … the runnable state for threads that are executing … in the Java virtual machine, … blocked which in Java means a thread is blocked … waiting for a monitor lock which we'll cover later, … and the terminated state for after a thread has exited. … The two additional states that Java adds … are basically more specific variations of being blocked … while waiting on other threads. … In the waiting state, … a thread is waiting indefinitely … for another thread to perform a particular action. … And in the timed waiting state, … the thread will wait for another thread to perform an action … for up to a specific waiting time. … To demonstrate the lifecycle of a Java thread … from creation to termination, … I've created this example program … which recreates the interactions … between Olivia and me in the previous video … where I spawned her as a second thread …
- Parallel vs. sequential computing
- Shared vs. distributed memory
- Execution scheduling
- Thread lifecycle
- Mutual exclusion
- Synchronized methods
- Checking for liveness
Skill Level Advanced
Java Essential Training: Objects and APIswith David Gassner2h 46m Intermediate
Java Essential Training: Syntax and Structurewith David Gassner3h 9m Intermediate
1. Parallel Computing Hardware
2. Threads and Processes
3. Mutual Exclusion
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.