Apart from the fact that the Executor
interface has some advantages over plain threads (management, for example), is there any real internal difference (big perform
If you only get one Runnable
to execute, then there is no big difference between them.
Using plain thread may be a little more efficient because creating an ExecutorService
such as ThreadPoolExecutor
has something to do besides creating a new thread. For example, creating blocking queue, creating policy, though these things are done implicitly.
And you have to shutdown
the executor after this runnable has been executed. Otherwise the single thread in this pool will never exit.