Use single thread by default

This commit is contained in:
TheMode 2021-04-26 16:27:50 +02:00
parent 79d936936e
commit 495164d03b

View File

@ -8,7 +8,7 @@ import net.minestom.server.instance.InstanceManager;
import net.minestom.server.monitoring.TickMonitor;
import net.minestom.server.network.ConnectionManager;
import net.minestom.server.network.player.NettyPlayerConnection;
import net.minestom.server.thread.PerInstanceThreadProvider;
import net.minestom.server.thread.SingleThreadProvider;
import net.minestom.server.thread.ThreadProvider;
import net.minestom.server.utils.async.AsyncUtils;
import org.jetbrains.annotations.NotNull;
@ -31,19 +31,13 @@ public final class UpdateManager {
private volatile boolean stopRequested;
private ThreadProvider threadProvider;
// TODO make configurable
private ThreadProvider threadProvider = new SingleThreadProvider();
private final Queue<LongConsumer> tickStartCallbacks = Queues.newConcurrentLinkedQueue();
private final Queue<LongConsumer> tickEndCallbacks = Queues.newConcurrentLinkedQueue();
private final List<Consumer<TickMonitor>> tickMonitors = new CopyOnWriteArrayList<>();
{
// DEFAULT THREAD PROVIDER
threadProvider = new PerInstanceThreadProvider();
//threadProvider = new PerChunkThreadProvider();
//threadProvider = new SingleThreadProvider();
}
/**
* Should only be created in MinecraftServer.
*/