GuidedLoopHandlerpublic class GuidedLoopHandler extends LoopHandler
Fields Summary |
---|
protected int | minSize |
Constructors Summary |
---|
public GuidedLoopHandler(int start, int end, int min, int threads)
super(start, end, threads);
minSize = min;
|
Methods Summary |
---|
protected synchronized LoopRange | loopGetRange()
if (curLoop >= endLoop)
return null;
LoopRange ret = new LoopRange();
ret.start = curLoop;
int sizeLoop = (endLoop-curLoop)/numThreads;
curLoop += (sizeLoop>minSize)?sizeLoop:minSize;
ret.end = (curLoop<endLoop)?curLoop:endLoop;
return ret;
|
|