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
The major difference is in task execution policy.
By creating a Thread
instance or subclassing Thread
you are basically executing a single task.
Using Executors.newSingleThreadExecutor()
on the other hand allows you to submit multiple tasks. Since those tasks are guaranteed not to be executed concurrently, this allows you to exploit the following thread confinement benefits: