|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.proactive.core.group.threadpool.ThreadPool
A thread pool is a set of threads waiting for jobs. The thread in the pool are created one time and re-used for new jobs.
Field Summary | |
protected EndControler |
controler
The controler that is looking for the end of jobs to perform. |
Constructor Summary | |
ThreadPool()
Builds a ThreadPool. |
|
ThreadPool(int size)
Builds a ThreadPool, specifying the number of thread to create. |
Method Summary | |
void |
addAJob(AbstractProcessForGroup r)
Adds a job to the pending queue of the thread pool. |
void |
checkNumberOfThreads(int members)
Check wether the number of threads in this threadpool is sufficient compared to the number of members in the group |
void |
clean()
Interrupts the thread in the pool |
void |
complete()
Waits until the ThreadPool has no more job to execute (pending queue is empty). |
protected void |
createThreads(int number)
Creates the needed threads for this ThreadPool |
java.lang.Runnable |
getJobForThePendingQueue()
Picks up new job to execute in the pending queue. |
void |
ratio(int i)
Modifies the number of members served by one thread |
void |
thread(int i)
Modifies the number of additional threads to serve members |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EndControler controler
Constructor Detail |
public ThreadPool()
public ThreadPool(int size)
size
- - the number of thread in the thread pool.Method Detail |
protected void createThreads(int number)
number
- - the number of threads neededpublic void checkNumberOfThreads(int members)
members
- - the number of members in the grouppublic void ratio(int i)
i
- - the new ratiopublic void thread(int i)
i
- - the new numberpublic void addAJob(AbstractProcessForGroup r)
public java.lang.Runnable getJobForThePendingQueue()
public void complete()
public void clean()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |