Is java – atomicinteger implemented based on JNI?

Soneone told me that atomicinteger is implemented using JNI, so it is much faster than synchronization It's true?

Solution

It is unlikely to be implemented based on JNI because it means significant overhead Last time I looked like the openjdk implementation was based on sun misc. Methods in unsafe, which are mainly implemented as JVM primitives (method calls are specifically implemented with native code in the JVM)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>