摘要:
package com.study.cas;import sun.misc.Unsafe;import java.lang.reflect.Field;public class CounterUnsafe { volatile int i = 0; private static Unsafe uns 阅读全文
摘要:
public class Demo5 { /** threadLocal变量,每个线程都有一个副本,互不干扰 */ public static ThreadLocal<String> value = new ThreadLocal<>(); /** * threadlocal测试 * * @thro 阅读全文
摘要:
import java.util.concurrent.locks.LockSupport;/** 三种线程协作通信的方式:suspend/resume、wait/notify、park/unpark */public class Demo6 { /** 包子店 */ public static O 阅读全文