关闭。这个问题需要更多focused.它目前不接受答案。想改善这个问题吗?更新问题,使其仅关注一个问题editingthispost.5年前关闭。Improvethisquestion我对多线程增量的最佳性能进行了调查。我检查了基于同步、AtomicInteger和自定义实现的实现,就像在AtomicInteger中一样,但是使用parkNanos(1),在失败的CAS上。privateintcustomAtomic(){intret;for(;;){ret=intValue;if(unsafe.compareAndSwapInt(this,offsetIntValue,ret,++r