728x90
Difference Between newSingleThreadExecutor and newFixedThreadPool(1)
Similirity
newSingleThreadExecutor returns ExecutorService with single thread worker and newFixedThreadPool(1) also returns ExecutorService with single thread worker. In both case if thread terminates, new thread will be created.
Difference
ExecutorService returned by newSingleThreadExecutor can never increase its thread pool size more than one. ExecutorService returned by newFixedThreadPool(1) can increase its thread pool size more than one at run time by setCorePoolSize of the class ThreadPoolExecutor.
728x90
728x90