Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-12-16 16:31:19 +0000
committerEike Stepper2015-12-16 16:31:19 +0000
commit733aaabd8b1ccb6c41a3543f43f9324c45c912c1 (patch)
tree330785d42d0afe467e4787765447724ed7059b7c
parente9142a81c6100d7a24b8f7eb428e317702e58458 (diff)
downloadcdo-733aaabd8b1ccb6c41a3543f43f9324c45c912c1.tar.gz
cdo-733aaabd8b1ccb6c41a3543f43f9324c45c912c1.tar.xz
cdo-733aaabd8b1ccb6c41a3543f43f9324c45c912c1.zip
[475039] Enhance ThreadPool and use it as much as possible
Increase DEFAULT_MAXIMUM_POOL_SIZE = Integer.MAX_VALUE https://bugs.eclipse.org/bugs/show_bug.cgi?id=475039
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Config.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java8
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ThreadPool.java6
3 files changed, 10 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Config.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Config.java
index 349c70d994..fa6c869e38 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Config.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/Config.java
@@ -26,9 +26,9 @@ public abstract class Config implements IConfig
{
private static final long serialVersionUID = 1L;
- private static final int MAXIMUM_POOL_SIZE = Integer.MAX_VALUE;
+ private static final int MAXIMUM_POOL_SIZE = 1000;
- protected static ExecutorService executorService = ThreadPool.create("test", 20, MAXIMUM_POOL_SIZE, 30);
+ protected static ExecutorService executorService = ThreadPool.create("test", 20, MAXIMUM_POOL_SIZE, 10);
private String name;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
index 2b631d2508..d0f55e331f 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
@@ -116,10 +116,12 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
public static final String PROP_TEST_QUERY_HANDLER_PROVIDER = "test.repository.QueryHandlerProvider";
+ public static final String PROP_TEST_ENABLE_SERVER_BROWSER = "test.repository.EnableServerBrowser";
+
private static final boolean LOG_MULTI_VIEW_COMMIT = false;
- private static final Boolean enableServerBrowser = Boolean.valueOf(
- System.getProperty("org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser", "false"));
+ private static final Boolean enableServerBrowser = Boolean
+ .getBoolean("org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser");
private static final long serialVersionUID = 1L;
@@ -460,7 +462,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
}
});
- if (enableServerBrowser)
+ if (enableServerBrowser || Boolean.TRUE.equals(getTestProperty(PROP_TEST_ENABLE_SERVER_BROWSER)))
{
serverBrowser = new CDOServerBrowser(repositories);
serverBrowser.activate();
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ThreadPool.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ThreadPool.java
index 6eba989d3c..9b16746460 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ThreadPool.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ThreadPool.java
@@ -34,7 +34,7 @@ public class ThreadPool extends ThreadPoolExecutor implements RejectedExecutionH
public static final int DEFAULT_CORE_POOL_SIZE = 10;
- public static final int DEFAULT_MAXIMUM_POOL_SIZE = 100;
+ public static final int DEFAULT_MAXIMUM_POOL_SIZE = Integer.MAX_VALUE;
public static final long DEFAULT_KEEP_ALIVE_SECONDS = 60;
@@ -193,7 +193,7 @@ public class ThreadPool extends ThreadPoolExecutor implements RejectedExecutionH
/**
* @author Eike Stepper
*/
- private static final class WorkQueueJRE15 extends LinkedBlockingQueue<Runnable>implements WorkQueue
+ private static final class WorkQueueJRE15 extends LinkedBlockingQueue<Runnable> implements WorkQueue
{
private static final long serialVersionUID = 1L;
@@ -228,7 +228,7 @@ public class ThreadPool extends ThreadPoolExecutor implements RejectedExecutionH
/**
* @author Eike Stepper
*/
- private static final class WorkQueueJRE16 extends AbstractQueue<Runnable>implements WorkQueue
+ private static final class WorkQueueJRE16 extends AbstractQueue<Runnable> implements WorkQueue
{
private final BlockingQueue<Runnable> delegate = createDelegate();

Back to the top