在Java中 CycliBarriar 和 CountdownLatch 有什么区别?

答案解析

CyclicBarrier可循环使用,适合分阶段同步;CountDownLatch一次性,适合主线程等待子任务完成。