JUC tool class Phaser

brief introduction Java 7 introduces a new reusable synchronization barrier, Phaser phaser, which is similar to CyclicBarrier and CountDownLatch, but more powerful. CyclicBarrier solves the problem that CountDownLatch cannot be reused, but it still has the following shortcomings: 1) The counter value cannot be dynamically adjusted. If the nu ...

Posted by bluebyyou on Mon, 20 Sep 2021 04:38:35 +0200

Thread security issues for JUC collections

scene Because when working, you don't over-consider the issue of high concurrency. Most collections use normal lists, sets, maps. There's not much problem either. But if you're in a multi-threaded scenario where multiple threads are manipulating a collection at the same time, there's a lot of problem. Collection Security Issue Code Display L ...

Posted by SaxMan101 on Fri, 10 Sep 2021 18:13:05 +0200