Guava almost always has what you need.
ThreadFactory namedThreadFactory =
new ThreadFactoryBuilder().setNameFormat("my-sad-thread-%d").build()
and pass it off to your ExecutorService
.
More Related Contents:
- ExecutorService, how to wait for all tasks to finish
- Turning an ExecutorService to daemon in Java
- FixedThreadPool vs CachedThreadPool: the lesser of two evils
- Java: ExecutorService that blocks on submission after a certain queue size [duplicate]
- Removing all queued tasks of an ThreadPoolExecutor
- Dynamic Thread Pool
- What’s the difference between Thread start() and Runnable run()
- ExecutorService that interrupts tasks after a timeout
- Choose between ExecutorService’s submit and ExecutorService’s execute
- What are the advantages of using an ExecutorService?
- Is ExecutorService (specifically ThreadPoolExecutor) thread safe?
- RejectedExecutionException inside single executor service
- Runnable with a parameter?
- Threads configuration based on no. of CPU-cores
- Impossible to make a cached thread pool with a size limit?
- ThreadPoolExecutor Block When Queue Is Full?
- Java ExecutorService: awaitTermination of all recursively created tasks
- How to use invokeAll() to let all thread pool do their task?
- Should you synchronize the run method? Why or why not?
- How to shutdown an ExecutorService?
- AsyncTask.executeOnExecutor() before API Level 11
- What determines the number of threads a Java ForkJoinPool creates?
- ExecutorService vs Casual Thread Spawner
- How to pause/resume all threads in an ExecutorService in Java?
- Java Executors: how can I stop submitted tasks?
- Future task of ExecutorService not truly cancelling
- Controlling Task execution order with ExecutorService
- Why do variables passed to runnable need to be final?
- JAVAFX : why wait cursor needs a new thread?
- How can I shutdown Spring task executor/scheduler pools before all other beans in the web app are destroyed?