摘要: 1、减少锁的持有时间 比如用synchronized,最好使用synchronized(this)去修饰还需要同步的方法,减少锁持有的时间。 2、减少所得粒度 比如ConcurrentHashMap,在其内部分为16个(默认)Segment。如果需要在ConcurrentHashMap中添加一个元素 阅读全文