forked from j62/ctbrec
Use a cached thread pool instead of a fixed size thread pool
This commit is contained in:
parent
326f970aa5
commit
508a25f3b5
|
@ -8,7 +8,7 @@ import java.util.concurrent.Future;
|
||||||
|
|
||||||
public class GlobalThreadPool {
|
public class GlobalThreadPool {
|
||||||
|
|
||||||
private static ExecutorService threadPool = Executors.newFixedThreadPool(30, r -> {
|
private static ExecutorService threadPool = Executors.newCachedThreadPool(r -> {
|
||||||
Thread t = new Thread(r);
|
Thread t = new Thread(r);
|
||||||
t.setDaemon(true);
|
t.setDaemon(true);
|
||||||
t.setName("GlobalWorker-" + UUID.randomUUID().toString().substring(0, 8));
|
t.setName("GlobalWorker-" + UUID.randomUUID().toString().substring(0, 8));
|
||||||
|
|
Loading…
Reference in New Issue