- synchronized语句
- 同步的代码块尽量少
- locks split, 私有的对象锁代替this
- volatile
for double, long primitive type. - ThreadLocal
- 使用 JDK1.5提供的锁
java.util.concurrent.locks.Lock,
java.util.concurrent.locks.ReadWriteLock
java.util.concurrent.locks.Lock,
java.util.concurrent.locks.ReadWriteLock