1. JMM, java内存管理,指的是线程管理,保证线程安全

2. volatle and synchorozed

volatile is lightwweight, only variable while synchonzied is heavy. for variable and method.

volatile 只保证可见性,不保证原子性,要保证原子性需要AtomicInteger. Synchorined 都保证。

static单例

3. thread local

posted on 2020-03-22 12:03  connie313  阅读(149)  评论(0编辑  收藏  举报