Obtaining the Number of Running Threads

   

You saw in the ThreadGroup class that the method activeCount returned an estimate of the number of threads running within that ThreadGroup. The Thread class itself also has a method called activeCount. It is a static method that returns the number of threads that are running within the thread's ThreadGroup. Using this method, you don't have to get the ThreadGroup for the thread and ask it.

   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net