threadgroup « Development « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » Development » threadgroup 

1. Clustering using Threads in Java    stackoverflow.com

I have a job that takes too long time in Java. So I want to divide this job into threads and run them. After the threads finishes their jobs, returns to ...

2. What is the benefit of ThreadGroup in java over creating separate threads?    stackoverflow.com

Many methods like stop(), resume(), suspend() etc are deprecated. So is it useful to create threads using ThreadGroup?

3. How Get Inactive Threads of a ThreadGroup?    coderanch.com

OK, here's how you do it: /* * For testing purposes */ ThreadGroup tg = new ThreadGroup( "MyThreadGroup" ); Thread subThread = new Thread( tg, "New Thread - Inactive" ); try { /* * GETTING THREADS - PROBABLY BETTER TO GET IT BY USING * getDeclaredFields() AND LOOPING TILL GET ONE OF TYPE * Thread[] SINCE A FUTURE VERSION MIGHT CHANGE ...

4. what is the use of threadgroup?Advantages of it?    coderanch.com

i advice a thorough reading of any "java for dummies" or equivalent before posting. i don't see there is any Java tutorial forum available. Please check and post accordingly. any group is used to group things together for easy reference. This able to decouple the system. Imagine, you have a couple of loading job (IO operations) performed using Java threads. all ...

5. ThreadGroup .activeCount()    coderanch.com

Hi Anthony, I dont know the answer to your question, but I have a suggestion. ThreadGroup.enumerate will give you a list of the active threads. class Test { public static void main(String[] args) { ThreadGroup tg = Thread.currentThread().getThreadGroup(); while (tg.getParent()!=null) { tg=tg.getParent(); } // int count = tg.activeCount(); Thread[] t = new Thread[count]; System.out.println(count); // just curious // int count2 = ...

6. ThreadGroup    coderanch.com

7. threadgroup: activeCount and enumerate    coderanch.com

A question about threadgroup's activeCount and enumerate. We are looking at the number of threads in our Websphere application server (running on as400). If we look at the number of the recurvisely enumrated threads from the root threadgroup, it is constantly around the same figure of 150 active threads. However if we look at the activeCount, it rises every day with ...

9. ThreadGroup    coderanch.com

10. Thread question: while(threadGroup.activeCount()!=0)    forums.oracle.com

While that loop is spinning (which is a BAD idea to do by the way, so please feel free to smack the developer of that CPU-burning code upside the head with a dead mackerel!), the threads in that thread group are doing their thing and finishing their work, thus making the activeCount() return different values until finally all the threads are ...

11. Adding threads to ThreadGroup    forums.oracle.com

Whenever createAThread() method is called, a new thread is spawned. I want all the newly created threads (i.e. those that are spawned by createAThread() method) to belong to the same thread group so that I can, at any point of time, find out how many threads are active. I do not find a way to add these thread to a thread ...

12. Howto add thread to ThreadGroup    forums.oracle.com

example: public class OneThread extends Thread { public boolean state = true; public OneThread() { } public void run() { while( state != false ) { System.out.println("Running"); wait(2000); } } public void ThreadStop() { state = false; } } ThreadGroup thg = new ThreadGroup("etc"); OneThread one = OneThread(thg); one.start; This is correct? if I see you write for me. Richard

13. Closing threads from a ThreadGroup    forums.oracle.com

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.