You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/09/21 06:34:51 UTC
[isis] branch v2 updated (9bd3e0c -> a272909)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git.
from 9bd3e0c Merge branch 'master' into v2
add 3687f57 ISIS-1974: reinstates tests etc for simpleapp in CI
add 5d5c3e2 ISIS-1974: attempts to track down deadlock in validate
add e0cb21f ISIS-1974: runs SpecLoader in parallel, ensure min size
add e8fd9da ISIS-1899: adds refs to some academic dissertations
add 408d664 ISIS-1974: oops, that should've been Math.max ...
add 74f60b8 ISIS-1974: switches isis mojo logging back to INFO
new a272909 Merge branch 'master' into v2
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.gitlab-ci.yml | 3 ---
adocs/documentation/src/main/asciidoc/documentation.adoc | 5 +++++
.../java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java | 4 ++++
.../org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java | 7 +++++--
4 files changed, 14 insertions(+), 5 deletions(-)
[isis] 01/01: Merge branch 'master' into v2
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git
commit a272909bbc035c69dae3a80770898408e0a80ec1
Merge: 9bd3e0c 74f60b8
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Sep 21 08:34:14 2018 +0200
Merge branch 'master' into v2
.gitlab-ci.yml | 3 ---
adocs/documentation/src/main/asciidoc/documentation.adoc | 5 +++++
.../java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java | 4 ++++
.../org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java | 7 +++++--
4 files changed, 14 insertions(+), 5 deletions(-)
diff --cc core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
index 1fc66b8,9ffb7aa..bec3b05
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
@@@ -51,9 -53,10 +53,11 @@@ public abstract class IsisMojoAbstract
protected IsisMojoAbstract() {
}
+ @Override
public void execute() throws MojoExecutionException, MojoFailureException {
+ new IsisLoggingConfigurer(Level.INFO).configureLogging(".", new String[]{});
+
final ContextForMojo context = new ContextForMojo(mavenProject, getLog());
final Plugin plugin = MavenProjects.lookupPlugin(mavenProject, CURRENT_PLUGIN_KEY);
diff --cc core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
index b99167e,87f162f..d3178c3
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
@@@ -55,30 -47,43 +55,33 @@@ public final class ThreadPoolSupport im
private static final Logger LOG = LoggerFactory.getLogger(ThreadPoolSupport.class);
private final static int KEEP_ALIVE_TIME_SECS = 5;
- private final static int QUEUE_CAPACITY = 5000;
+ private final static int QUEUE_CAPACITY = Integer.MAX_VALUE;
+ private static final int MIN_CORE_POOL_SIZE = 4;
+ private static final int MIN_MAX_POOL_SIZE = 4;
+
private final ThreadGroup group;
private final ThreadPoolExecutor concurrentExecutor;
private final ThreadPoolExecutor sequentialExecutor;
- private static ThreadPoolSupport threadPoolSupport;
-
- public static synchronized ThreadPoolSupport getInstance() {
- if (threadPoolSupport == null) {
- threadPoolSupport = new ThreadPoolSupport();
- }
- return threadPoolSupport;
+ /**
+ * @return the application-scoped singleton ThreadPoolSupport instance
+ */
+ public static ThreadPoolSupport getInstance() {
+ return _Context.computeIfAbsent(ThreadPoolSupport.class, __-> new ThreadPoolSupport());
}
-
+
private ThreadPoolSupport() {
+
group = new ThreadGroup(ThreadPoolSupport.class.getName());
- final int corePoolSize = Runtime.getRuntime().availableProcessors();
- final int maximumPoolSize = Runtime.getRuntime().availableProcessors();
+ final int corePoolSize = Math.max(Runtime.getRuntime().availableProcessors(), MIN_CORE_POOL_SIZE);
+ final int maximumPoolSize = Math.max(Runtime.getRuntime().availableProcessors(), MIN_MAX_POOL_SIZE);
- ThreadFactory threadFactory = new ThreadFactory() {
- @Override
- public Thread newThread(final Runnable r) {
- return new Thread(group, r);
- }
- };
+ final ThreadFactory threadFactory = (Runnable r) -> new Thread(group, r);
- Supplier<BlockingQueue<Runnable>> workQueueFactory = new Supplier<BlockingQueue<Runnable>>() {
- @Override
- public BlockingQueue<Runnable> get() {
- return new LinkedBlockingQueue<>(QUEUE_CAPACITY);
- }
- };
+ final Supplier<BlockingQueue<Runnable>> workQueueFactory =
+ ()->new LinkedBlockingQueue<>(QUEUE_CAPACITY);
concurrentExecutor = new ThreadPoolExecutor(
corePoolSize,