Async mode helps a little

This commit is contained in:
Tony Garnock-Jones 2023-10-28 18:41:10 +02:00
parent 94646a92de
commit 9e971de6b0
1 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,12 @@ import java.util.logging.Logger;
public class Actor {
private final static AtomicLong _count = new AtomicLong(0);
private final static AtomicLong _actorId = new AtomicLong(0);
protected final static ExecutorService _executor = Executors.newWorkStealingPool();
protected final static ExecutorService _executor = new ForkJoinPool(
Runtime.getRuntime().availableProcessors(),
ForkJoinPool.defaultForkJoinWorkerThreadFactory,
null,
true
);
protected final static ScheduledExecutorService _scheduledExecutor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors());
private final String _name;