public class ParallelCore
extends java.lang.Object
ThreadPoolExecutor
.
TODO: make configurable how many threads are used.
Modifier and Type | Field and Description |
---|---|
static int |
ALL_PROCESSORS
The number of CPUs to use.
|
private int |
connected
Number of connected submitters.
|
private java.util.concurrent.ThreadPoolExecutor |
executor
Executor service.
|
private int |
processors
Maximum number of processors to use.
|
private static ParallelCore |
STATIC
Static core
|
Modifier | Constructor and Description |
---|---|
protected |
ParallelCore(int processors)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to the executor.
|
void |
disconnect()
Disconnect to the executor.
|
static ParallelCore |
getCore()
Get the static core object.
|
int |
getParallelism()
Get desired level of parallelism
|
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task)
Submit a task to the executor core.
|
public static final int ALL_PROCESSORS
private static final ParallelCore STATIC
private volatile java.util.concurrent.ThreadPoolExecutor executor
private volatile int connected
private int processors
public static ParallelCore getCore()
public int getParallelism()
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
task
- Submitted taskpublic void connect()
public void disconnect()
Copyright © 2019 ELKI Development Team. License information.