Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General 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