public class ComputerThreads extends java.lang.Object
Usage: To obtain a reference to the thread pool use
ComputerThreads.getPool()
. Once a pool has been created it must
be shutdown with ComputerThreads.terminate()
to exit JAS.
Modifier and Type | Field and Description |
---|---|
static int |
N_CPUS
Number of processors.
|
static int |
N_THREADS |
static boolean |
NO_THREADS
Flag for thread usage.
|
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.ExecutorService |
getPool()
Get the thread pool.
|
static long |
getTimeout()
Get timeout.
|
static java.util.concurrent.TimeUnit |
getTimeUnit()
Get TimeUnit.
|
static boolean |
isRunning()
Test if a pool is running.
|
static void |
setNoThreads()
Set no thread usage.
|
static void |
setThreads()
Set thread usage.
|
static void |
setTimeout(long t)
Set timeout.
|
static void |
setTimeUnit(java.util.concurrent.TimeUnit t)
Set TimeUnit.
|
static void |
terminate()
Stop execution.
|
public static boolean NO_THREADS
public static final int N_CPUS
public static final int N_THREADS
public static boolean isRunning()
public static java.util.concurrent.ExecutorService getPool()
public static void terminate()
public static void setNoThreads()
public static void setThreads()
public static void setTimeout(long t)
t
- time value to setpublic static long getTimeout()
public static void setTimeUnit(java.util.concurrent.TimeUnit t)
t
- TimeUnit value to setpublic static java.util.concurrent.TimeUnit getTimeUnit()