* Reduced created JBoss OneWay Threads on Client from 100 to 10. Some formatting.

This commit is contained in:
LevelX2 2014-02-21 15:03:24 +01:00
parent 8491b5b90b
commit 8549f72010
3 changed files with 298 additions and 209 deletions

View file

@ -10,12 +10,16 @@ import java.util.concurrent.TimeUnit;
*
* @author ayrat
*/
@SuppressWarnings("unchecked")
public class ThreadUtils {
public static final ThreadPoolExecutor threadPool;
public static final ThreadPoolExecutor threadPool2;
private static int threadCount;
static {
/** used in CardInfoPaneImpl
*
*/
threadPool = new ThreadPoolExecutor(4, 4, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
@Override
public Thread newThread (Runnable runnable) {
@ -26,6 +30,10 @@ public class ThreadUtils {
}
});
threadPool.prestartAllCoreThreads();
/**
* Used for MageActionCallback
*/
threadPool2 = new ThreadPoolExecutor(4, 4, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
@Override
public Thread newThread (Runnable runnable) {