26
面试官:说说CountDownLatch,CyclicBarrier,Semaphore的原理?-程序员麦冬
source link: https://blog.51cto.com/14849432/2542962
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
CountDownLatchCountDownLatch适用于在多线程的场景需要等待所有子线程全部执行完毕之后再做操作的场景。举个例子,早上部门开会,有人在上厕所,这时候需要等待所有人从厕所回来之后才能开始会议。public class CountDownLatchTest { private static int num = 3; private static CountDownLa
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK