Learn how to investigate key attributes of Java threads including ID, name, priority, state, and ThreadGroup with an example Java program in this video.
- [Instructor] In addition to a threads state, … which can be retrieved using the getState() method, … there are a few other useful properties and methods … for java threads that are good to know. … If you need to access the thread that's currently executing, … you can use the currentThread() method, … which returns a reference to the currently … executing thread object. … Whenever a new thread gets created, it will be assigned … a thread ID. … This is a positive long number that serves … as a unique identifier for the thread, and remains … unchanged during it's lifetime. … That thread ID can be retrieved using the getID() method. … Now, keep in mind that after a thread terminates, … that ID number will be available … for other new threads to reuse. … Another related property is the threads name, … which is a string that can be used … for identification purposes. … Now, more than one thread can have the same name, … but they'll never have the thread ID. … There are several variations of the thread constructor …
- 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.