摘要:
CyclicBarrier测试案例一: package com.dwz.utils; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import java. 阅读全文
摘要:
数据完整性 1.数据格式完整 2.数据大小完整 package com.dwz.utils; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.concurrent 阅读全文
摘要:
1.中断主线程使await()生效 package com.dwz.utils; import java.util.concurrent.CountDownLatch; /** * 中断主线程使await()生效 */ public class CountDownLatchExample4 { pu 阅读全文
摘要:
1.使用executor.awaitTermination(1, TimeUnit.HOURS); package com.dwz.utils; import java.util.Random; import java.util.concurrent.CountDownLatch; import j 阅读全文
摘要:
创建目标对象 static class Simple{ private long l = 0; public Simple() { this.l = 1; System.out.println(" "); } public long get() { return this.l; } } 创建对象实例 阅读全文
摘要:
创建unsafe对象 private static Unsafe getUnsafe() { try { Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); return (Unsafe) f.ge 阅读全文
摘要:
AtomicIntegerFieldUpdater测试类 package com.dwz.atomicApi; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; public class AtomicIntegerFieldU 阅读全文
摘要:
使用AtomicStampedReference解决CAS机制中ABA问题 package concurrency; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicStampedRefer 阅读全文
摘要:
参考文章: 1.接口的幂等性 2.分布式系统中接口的幂等性 阅读全文
摘要:
package com.dwz.atomicApi; import java.util.concurrent.atomic.AtomicBoolean; public class AtomicBooleanFlag { private final static AtomicBoolean flag 阅读全文