Methods Summary |
---|
public void | loopDoRange(int start, int end)
|
protected synchronized LoopHandler$LoopRange | loopGetRange()
if (curLoop >= endLoop)
return null;
LoopRange ret = new LoopRange();
ret.start = curLoop;
curLoop += (endLoop-startLoop)/numThreads+1;
ret.end = (curLoop<endLoop)?curLoop:endLoop;
return ret;
|
public void | loopProcess()
for (int i = 0; i < numThreads; i++) {
lookupThreads[i] = new Thread(this);
lookupThreads[i].start();
}
for (int i = 0; i < numThreads; i++) {
try {
lookupThreads[i].join();
} catch (InterruptedException iex) {}
}
|
public void | run()
LoopRange str;
while ((str = loopGetRange()) != null) {
loopDoRange(str.start, str.end);
}
|