public class ParallelCore extends 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 AtomicInteger |
connected
Number of connected submitters.
|
(package private) 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> Future<T> |
submit(Callable<T> task)
Submit a task to the executor core.
|
public static final int ALL_PROCESSORS
private static final ParallelCore STATIC
ThreadPoolExecutor executor
private AtomicInteger connected
private int processors
public static ParallelCore getCore()
public int getParallelism()
public <T> Future<T> submit(Callable<T> task)
task
- Submitted taskpublic void connect()
public void disconnect()
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.