|
Re: How do I wait for the thread from theThreadPool to finish?: msg#00036java.jsr.166-concurrency
Correction: completionService.submit(task, null).get(); -or- completionService.submit(task, null); completionService.take(); ----- Original Message ----- From: "Joe Bowbeer" <jozart@xxxxxxxxx> To: <concurrency-interest@xxxxxxxxxxxxxxxxxxxx> Sent: Friday, February 25, 2005 8:27 PM Subject: Re: [concurrency-interest] How do I wait for the thread from theThreadPool to finish? MH asks: > Once I create my runnable task that needs to be executed, > how does the calling thread wait for the [task] to finish See ExecutorCompletionService completionService.submit(task, null).take(); ----- Original Message ----- From: "Minnie Haridasa" <minnieh@xxxxxxxxxxxxxxxxxx> To: <concurrency-interest@xxxxxxxxxxxxxxxxxxxx> Sent: Friday, February 25, 2005 8:07 PM Subject: [concurrency-interest] How do I wait for the thread from theThreadPool to finish? I am trying to use the PooledExecutor to create a thread pool. Once I create my runnable task that needs to be executed, how does the calling thread wait for the thread in the pool to finish, especially since I do not have the handle to the thread that is executing the task. threadPool.execute(task); // At this point the calling thread needs to wait for the task to complete. I am quite new to this Library and would appreciate your help. Thanks MH
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: How do I wait for the thread from theThreadPool to finish?, Joe Bowbeer |
|---|---|
| Next by Date: | backport-concurrent vs. concurrent-1.3.4, Holger Hoffstaette |
| Previous by Thread: | How do I wait for the thread from the ThreadPool to finish?, Minnie Haridasa |
| Next by Thread: | backport-concurrent vs. concurrent-1.3.4, Holger Hoffstaette |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |