public interface ThreadPool
ThreadPool
specifies basic thread-pooling
operations such that third-party implementations may be used
without requiring changes to BioJava.
Modifier and Type | Method and Description |
---|---|
void |
addRequest(Runnable task)
addRequest requests that a Runnable
be scheduled to be run by one of the threads in the pool. |
void |
startThreads()
startThreads starts all the threads running and
opens the pool to requests. |
void |
stopThreads()
stopThreads causes all running threads to stop
when their current task is complete. |
void |
waitForThreads()
waitForThreads temporarily closes the pool to new
requests until such time as the current request queue has been
emptied and all running tasks completed. |
void addRequest(Runnable task)
addRequest
requests that a Runnable
be scheduled to be run by one of the threads in the pool.task
- a Runnable
.void startThreads()
startThreads
starts all the threads running and
opens the pool to requests.void stopThreads()
stopThreads
causes all running threads to stop
when their current task is complete. It also closes the pool to
new requests. Requests still queued are not done and the queue
is emptied.void waitForThreads()
waitForThreads
temporarily closes the pool to new
requests until such time as the current request queue has been
emptied and all running tasks completed.Copyright © 2014 BioJava. All rights reserved.