|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threed.jpct.threading.Worker
A simple multi-threading framework that jPCT uses to speed up some operations on multicore cpus. You are free to use it in your own application by creating your own Worker instance.
| Constructor Summary | |
Worker(int queues)
Creates a new Worker. |
|
| Method Summary | |
void |
add(WorkLoad wl)
Adds a new WorkLoad to the queue with the least load. |
void |
add(WorkLoad wl,
int queue)
Adds a new WorkLoad to the given queue. |
void |
dispose()
Terminates the worker and all running threads. |
void |
finalize()
|
int |
getQueueCount()
Returns the number of queues that the Worker actually uses. |
boolean |
isDone(WorkLoad wl)
Is the Worker already done with a given WorkLoad? |
void |
waitFor(java.lang.Class type)
Waits for all WorksLoads that are instances of the given Class to be processed. |
void |
waitForAll()
Waits for all WorkLoads to be processed. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Worker(int queues)
queues - the maximal number of queues, i.e. the maximum number of
threads being spawned| Method Detail |
public boolean isDone(WorkLoad wl)
wl - the WorkLoad
public int getQueueCount()
public void waitForAll()
public void waitFor(java.lang.Class type)
type - the class
public void add(WorkLoad wl,
int queue)
wl - the WorkLoadqueue - the queuepublic void add(WorkLoad wl)
wl - the WorkLoadpublic void dispose()
public void finalize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||