摘要:
用法一:在关联数据类中创建private static ThreadLocal ThreaLocal的JDK文档中说明:ThreadLocal instances are typically private static fields in classes that wish to associat 阅读全文
摘要:
1、首先为何要指令重排序(instruction reordering)? 编译器或运行时环境为了优化程序性能而采取的对指令进行重新排序执行的一种手段。 也就是说,对于下面两条语句: int a = 10; int b = 20; 在计算机执行上面两句话的时候,有可能第二条语句会先于第一条语句执行。 阅读全文