Public Member Functions | |
WorkerThread (Region[] ourRegions, int timePerStep) | |
void | setBarriers (CyclicBarrier barrierStart, CyclicBarrier barrierDuringWork, CyclicBarrier barrierFinish) |
void | addChangedRegion (int i) |
void | run () |
This thread is meant to run parallel with multiple others to gain advantage of multiple CPUs. All simulation tasks are initiated from this class!
|
inline |
The main constructor for the worker thread. Don't use any other constructor inherited from the Thread class as all parameters are essential!
ourRegions | the regions which are assigned to us. |
timePerStep | the time in milliseconds for one step |
|
inline |
Adds a region to the list of changed region (so that it gets updated).
i | the number of the region in this thread |
|
inline |
The main method. All simulation is initiated from here!
|
inline |
Set CyclicBarriers
for thread synchronization.
barrierStart | the barrier for starting |
barrierDuringWork | the barrier after adjusting the speed |
barrierFinish | the barrier after completing all tasks |