File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Threads and Synchronization
Create new Thread with FutureTask vs using Executor
Joined: Mar 26, 2010
Aug 15, 2013 04:42:36
I know that we can execute a
However, if we create a new Thread with
in the classical way (because
also implements Runnable), what will be the difference?
Thread thread = new Thread(futureTask); thread.start();
In any case, we can still call
to get the execution result.
Joined: Jan 28, 2003
Aug 15, 2013 05:05:11
The difference is the executor will use a Thread pool to execute the task, re-using threads when possible. Also, depending on which executor you use, you could get a Queue with multiple Futures returned in the order of completion.
I agree. Here's the link:
subject: Create new Thread with FutureTask vs using Executor
how to generate thread in web application
use of FutureTask
Catching exception from a Thread
Using FutureTask with Tomcat's thread pool
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015