public class ThreadPoolJdkForkJoin extends IThreadPool
NUM_THREADS
Modifier and Type | Method and Description |
---|---|
void |
add(PTask item)
add a task to the pool
|
void |
add(PTask item,
int threadId)
add a task to the pool
|
int |
getPoolSize() |
static ThreadPoolJdkForkJoin |
initialize() |
static ThreadPoolJdkForkJoin |
initialize(int numOfThreads) |
void |
join()
wait for termination
|
void |
shutdown()
shutdown the thread pool
|
void |
sleep()
Set thread pool to state sleep.
|
void |
start()
start the thread pool
|
void |
trigger()
trigger workers (used for the synchronization)
|
void |
weakUp()
Wake up the thread pool.
|
public static ThreadPoolJdkForkJoin initialize()
public static ThreadPoolJdkForkJoin initialize(int numOfThreads)
public void start()
IThreadPool
start
in class IThreadPool
public void shutdown() throws java.lang.InterruptedException
IThreadPool
shutdown
in class IThreadPool
java.lang.InterruptedException
public void join() throws java.lang.InterruptedException
IThreadPool
join
in class IThreadPool
java.lang.InterruptedException
public void sleep()
IThreadPool
sleep
in class IThreadPool
public void weakUp()
IThreadPool
weakUp
in class IThreadPool
public void trigger()
IThreadPool
trigger
in class IThreadPool
public void add(PTask item)
IThreadPool
add
in class IThreadPool
public void add(PTask item, int threadId)
IThreadPool
add
in class IThreadPool
public int getPoolSize()
getPoolSize
in class IThreadPool