From a734bb6a693ee006fb896438aedbdd225710e6c4 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 3 Mar 2024 19:08:23 -0600 Subject: [PATCH] Increase AbstractNewDataSourceHandler update lock count 2x -> 4x Trying to reduce lock collisions. --- .../core/file/AbstractNewDataSourceHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java index 8978ae0af..c6ec0a08a 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractNewDataSourceHandler.java @@ -75,9 +75,9 @@ public abstract class AbstractNewDataSourceHandler LOGGER.warn("Unable to create full data folder, file saving may fail."); } - // the lock array's length is double the number of CPU cores so the number of collisions + // the lock array's length is 4x the number of CPU cores so the number of collisions // should be relatively low without having too many extra locks - int lockCount = Runtime.getRuntime().availableProcessors() * 2; + int lockCount = Runtime.getRuntime().availableProcessors() * 4; this.updateLockArray = new ReentrantLock[lockCount]; for (int i = 0; i < lockCount; i++) {