Reduce CPU load when moving around the world
Should've made this multiple commits, but too late now - Create ConfigThreadPool to remove duplicate thread setup/config code - Move configurable thread pools into their own ThreadPools class - Add a semaphore to limit how many LOD builder/lighting/bufferBuilder threads can be active at once
This commit is contained in:
+3
-1
@@ -27,10 +27,12 @@ import java.util.function.Consumer;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
|
||||
import com.seibel.distanthorizons.core.generation.WorldGenerationQueue;
|
||||
import com.seibel.distanthorizons.core.util.ThreadUtil;
|
||||
import com.seibel.distanthorizons.core.util.objects.UncheckedInterruptedException;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.distanthorizons.core.pos.DhChunkPos;
|
||||
import com.seibel.distanthorizons.core.util.objects.EventTimer;
|
||||
import com.seibel.distanthorizons.core.util.threading.ThreadPools;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -121,7 +123,7 @@ public final class GenerationEvent
|
||||
public boolean terminate()
|
||||
{
|
||||
LOGGER.info("======================DUMPING ALL THREADS FOR WORLD GEN=======================");
|
||||
WorldGenerationQueue.THREAD_FACTORY.dumpAllThreadStacks();
|
||||
ThreadPools.WORLD_GEN_THREAD_FACTORY.dumpAllThreadStacks();
|
||||
this.future.cancel(true);
|
||||
return this.future.isCancelled();
|
||||
}
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: 643112953e...446c274094
Reference in New Issue
Block a user