This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ThreadPools and monitoring

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There have been many discussions about this. I have implemented the Jakarta Common threadpool and it works, but I now need more options.

ThreadPool threadPool = new DefaultThreadPool(3);

while ( i != 5){
threadPool.invokeLater(new MyObject); // This will call the run method
}

public void run(){
//do something....
}

*******************
Other notes about my code:
1) My class implements Runnable



My questions:
2) How can my code tell when the threads have all finished executing?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic