lowered priority of non-Jetty threads by one to give Jetty threads more relative priority

This commit is contained in:
Axel Uhl committed 2013-06-25 12:42:38 +02:00
1 parent d322cea0fd
commit a77610cb2e
3 files changed
+6 -3

No files matched your search

@@ -28,6 +28,7 @@ import com.sap.sailing.domain.leaderboard.ScoreCorrectionListener;
import com.sap.sailing.domain.tracking.RaceChangeListener;
import com.sap.sailing.domain.tracking.TrackedRegattaRegistry;
import com.sap.sailing.util.impl.LockUtil;
import com.sap.sailing.util.impl.ThreadFactoryWithPriority;
/**
* Caches the expensive to compute {@link LeaderboardDTO} results of a
@@ -70,7 +71,7 @@ public class LeaderboardDTOCache implements LeaderboardCache {
private static final Executor computeLeadearboardByNameExecutor = new ThreadPoolExecutor(/* corePoolSize */ THREAD_POOL_SIZE,
/* maximumPoolSize */ THREAD_POOL_SIZE,
/* keepAliveTime */ 60, TimeUnit.SECONDS,
/* workQueue */ new LinkedBlockingQueue<Runnable>());
/* workQueue */ new LinkedBlockingQueue<Runnable>(), new ThreadFactoryWithPriority(Thread.NORM_PRIORITY-1));
private final LeaderboardCacheManager leaderboardCacheManager;
@@ -83,6 +83,7 @@ import com.sap.sailing.domain.tracking.TrackedRaceStatus;
import com.sap.sailing.domain.tracking.TrackedRegattaRegistry;
import com.sap.sailing.domain.tracking.Wind;
import com.sap.sailing.util.impl.RaceColumnListeners;
import com.sap.sailing.util.impl.ThreadFactoryWithPriority;
/**
* Base implementation for various types of leaderboards. The {@link RaceColumnListener} implementation forwards events
@@ -361,7 +362,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
executor = new ThreadPoolExecutor(/* corePoolSize */ THREAD_POOL_SIZE,
/* maximumPoolSize */ THREAD_POOL_SIZE,
/* keepAliveTime */ 60, TimeUnit.SECONDS,
/* workQueue */ new LinkedBlockingQueue<Runnable>());
/* workQueue */ new LinkedBlockingQueue<Runnable>(), new ThreadFactoryWithPriority(Thread.NORM_PRIORITY-1));
}
@Override
@@ -22,6 +22,7 @@ import java.util.logging.Logger;
import com.sap.sailing.util.SmartFutureCache.UpdateInterval;
import com.sap.sailing.util.impl.LockUtil;
import com.sap.sailing.util.impl.NamedReentrantReadWriteLock;
import com.sap.sailing.util.impl.ThreadFactoryWithPriority;
/**
* A cache for which a background update can be triggered. Readers can decide whether they want to wait for any ongoing
@@ -99,7 +100,7 @@ public class SmartFutureCache<K, V, U extends UpdateInterval<U>> {
private final static Executor recalculator = new ThreadPoolExecutor(/* corePoolSize */ THREAD_POOL_SIZE,
/* maximumPoolSize */ THREAD_POOL_SIZE,
/* keepAliveTime */ 60, TimeUnit.SECONDS,
/* workQueue */ new LinkedBlockingQueue<Runnable>());
/* workQueue */ new LinkedBlockingQueue<Runnable>(), new ThreadFactoryWithPriority(Thread.NORM_PRIORITY-1));
private final CacheUpdater<K, V, U> cacheUpdateComputer;