import ;
import ;
import ;
import ;
import ;
public class MultiThreadTest {
public static void main(String[] args) throws Exception {
List<Integer> idList = new ArrayList<>();
for (int i = 0; i < 1000; i++) {
(i);
}
int threadNum = 10;
ExecutorService executorService = (threadNum);
CountDownLatch countDownLatch = new CountDownLatch(threadNum);
int perSize = () / threadNum;
for (int i = 0; i < threadNum; i++) {
MultiThread thread = new MultiThread();
((i * perSize, (i + 1) * perSize));
(countDownLatch);
(thread);
}
();
();
}
}
class MultiThread extends Thread {
private List<Integer> idList;
private CountDownLatch countDownLatch;
public void setIdList(List<Integer> idList) {
= idList;
}
public void setCountDownLatch(CountDownLatch countDownLatch) {
= countDownLatch;
}
@Override
public void run() {
try {
(1000);
();
} catch (Exception e) {
();
} finally {
if (countDownLatch != null) {
();
}
}
}
}