If you read the documentation for Executor.execute, it says:
The command may execute in a new thread, in a pooled thread, or in the
calling thread, at the discretion of the Executor implementation.
ExecutorService is an interface which defines a broad contract. If you look at implementations, say
ThreadPoolExecutor for example, you will have more precise characteristics:
An ExecutorService that executes each submitted task using one of possibly several pooled threads, normally configured using Executors factory methods.
Note that the javadoc linked above details the fact that the
ExecutorServices returned by the various
Executors factory methods are
So to answer your question more directly:
Executors.newFixedThreadPool(threads) will not execute tasks on the calling thread.