Skip to content

Commit

Permalink
+ using cached pool for admin tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed May 21, 2024
1 parent f2aea5e commit 1965a33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.q3769</groupId>
<artifactId>conseq4j</artifactId>
<version>20230922.20230924.20240516</version>
<version>20230922.20230924.20240521</version>
<packaging>jar</packaging>
<name>conseq4j</name>
<description>A Java concurrent API to sequence related tasks while concurring unrelated ones</description>
Expand Down Expand Up @@ -186,19 +186,19 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.9.3</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.3</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -221,7 +221,7 @@
<dependency>
<groupId>io.github.q3769</groupId>
<artifactId>coco4j</artifactId>
<version>10.0.0</version>
<version>10.1.0</version>
</dependency>
</dependencies>
<properties>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/conseq4j/execute/ConseqExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static coco4j.Tasks.callUnchecked;

import coco4j.DefensiveFuture;
import coco4j.ThreadFactories;
import conseq4j.Terminable;
import java.util.List;
import java.util.Map;
Expand All @@ -47,9 +48,8 @@
@ToString
public final class ConseqExecutor implements SequentialExecutor, Terminable, AutoCloseable {
private static final int DEFAULT_WORKER_CONCURRENCY = Runtime.getRuntime().availableProcessors();
private static final int ADMIN_WORKER_CONCURRENCY =
Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
private final ExecutorService adminService = Executors.newWorkStealingPool(ADMIN_WORKER_CONCURRENCY);
private final ExecutorService adminService =
Executors.newCachedThreadPool(ThreadFactories.newPlatformThreadFactory("conseq4j-admin"));
private final Map<Object, CompletableFuture<?>> activeSequentialTasks = new ConcurrentHashMap<>();
/**
* The worker thread pool facilitates the overall async execution, independent of the submitted tasks. Any thread
Expand Down
25 changes: 0 additions & 25 deletions src/test/resources/elf4j-test.properties

This file was deleted.

0 comments on commit 1965a33

Please sign in to comment.