This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes ThreadPools and monitoring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "ThreadPools and monitoring" Watch "ThreadPools and monitoring" New topic
Author

ThreadPools and monitoring

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ThreadPools and monitoring
 
jQuery in Action, 3rd edition