Repository navigation
java-concurrent-programming-explain
Public
About
No description or website provided.
Topics
concurrent concurrent-programming explain java
Resources
Readme
License
Activity
Custom properties
Stars
0 stars
Watchers
1 watching
Forks
0 forks
Report repository
Branches
Tags
Go to Branches page Go to Tags page
Latest commit
History
11 Commits
View commit history for this file.
Folders and files
Repository files navigation
java-concurrent-programming-explain
Thread.join()
CountDownLatch
CyclicBarrier
- 子线程完成等待之后,调用指定的线程执行,示例 ,一个类完成上述功能,相关示例 .
CountDownLatch & CyclicBarrier
-
CountDownLatch 和 CyclicBarrier 都能够实现线程之间的等待,只不过它们侧重点不同:
-
CountDownLatch 一般用于某个线程A等待若干个其他线程执行完任务之后,它才执行;
-
而 CyclicBarrier 一般用于一组线程互相等待至某个状态,然后这一组线程再同时执行;
-
另外,CountDownLatch 是不能够重用的,而 CyclicBarrier 是可以重用的。
Semaphore
Semaphore 其实和锁有点类似,它一般用于控制对某组资源的访问权限。
- 初始化时设置大小, 线程每次获取和存放回去都有数量可选。
ForkJoin
資料
LICENSE
About
No description or website provided.
Topics
concurrent concurrent-programming explain java
Resources
Readme
License
Activity
Custom properties
Stars
0 stars
Watchers
1 watching
Forks
0 forks
Report repository
Releases
Packages
Contributors
Languages