File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Thread Joining and ExecutorService Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Thread Joining and ExecutorService" Watch "Thread Joining and ExecutorService" New topic
Author

Thread Joining and ExecutorService

Harsha Smith
Ranch Hand

Joined: Jul 18, 2011
Posts: 287
how to call join method on a thread that was started by ExecutorService object?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3053
    
    1

You shouldn't. Instead, when you submit a task to the ExecutorService, you can use the Future of that task to wait until the task is finished, through the get() method.
John Vorwald
Ranch Hand

Joined: Sep 26, 2010
Posts: 139
You may be able to assign a runnable to wait on, and then submitted the object to an ExecutorService.
See question on join.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Thread Joining and ExecutorService
 
Similar Threads
Thread and Web Applications
ExecutorService with 1 thread
Why the Runnable cant be resolved
Making a Execution of a tasks take only constant Number of seconds
ExecutorService and FutureTask - Blocked Thread