File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes ThreadGroup.enumerate(Thread[]) Vs ThreadGroup.enumerate(Thread[],boolean) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "ThreadGroup.enumerate(Thread[]) Vs ThreadGroup.enumerate(Thread[],boolean)" Watch "ThreadGroup.enumerate(Thread[]) Vs ThreadGroup.enumerate(Thread[],boolean)" New topic
Author

ThreadGroup.enumerate(Thread[]) Vs ThreadGroup.enumerate(Thread[],boolean)

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 568
The javadoc for these 2 methods: ThreadGroup.enumerate(Thread[]) Vs ThreadGroup.enumerate(Thread[],boolean) seems to refer to the same thing. Both listing the active threads in the current thread group PLUS the active threads in subgroups of the current group. What are the difference between them?
Harry Ram
Greenhorn

Joined: Dec 08, 2009
Posts: 1
By default, the ThreadGroup.enumerate(Thread[]) method copies all the active thread in this thread group and its subgroup. The other method can be used with the boolean value set to false when you need to copy only the active threads of this group and not its subgroup.
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 568
So, ThreadGroup.enumerate(Thread[] t) equivalent to ThreadGroup.enumerate(Thread[] t,true) ?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That's what the Javadocs imply, no? Seems like it'd be pretty simple to test empiracally as well.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ThreadGroup.enumerate(Thread[]) Vs ThreadGroup.enumerate(Thread[],boolean)
 
Similar Threads
ThreadGroup .activeCount()
display child threads !
Count all threads
# of Threads
Master Vs Slave (MainMethods)