The Thread class defines a number of methods useful for thread management. These include static methods, which provide information about, or affect the status of, the thread invoking the method. The other methods must be invoked using the dot operator are invoked on the thread object on which the method was called. Here are some of the static methods available in a Thread class.
- View Offline
- [Instructor] There are times where you'll want to use…some of the advanced thread tasks.…The thread class defines a number of methods…that are useful for thread management.…These include static, and non-static methods.…The static methods provide information about,…or affect the status of the thread invoking the method.…Non-static methods operate on the calling thread,…using the dot operator.…Let's take a look at some of the static methods…that are available, in a thread class.…
We'll start with active count.…This returns an estimate of the number of active threads…in the current threads thread group, and its subgroups.…Another handy method is the current thread.…This returns a reference…to the currently executing thread object.…This allows us to get the name, the status, the priority.…Is it alive? Is it a demon thread?…by calling current thread.…Enumerate is another helpful method,…which copies into the specified array every active thread…in the current threads thread group, and its subgroups.…
In this case, I have enumerate thread bracket, bracket,…
- What is a thread?
- Creating threads
- Syncing threads
- Understanding concurrency
- Working with the Java locking framework