• 请不要在回答技术问题时复制粘贴 AI 生成的内容
fanshuzaizai
V2EX  ›  程序员

Java 的 Unsafe 中 putInt/putIntVolatile/putOrderedInt 测试中并没有区别

  •  
  •   fanshuzaizai · Jun 3, 2020 · 1988 views
    This topic created in 2194 days ago, the information mentioned may be changed or developed.

    变量没有 volatile 的情况下,putIntVolatile 也起不到增加 volatile 的效果,和 putInt 一样 变量有 volatile 的情况下,putInt/putIntVolatile/putOrderedInt 三种方法都起到了 volatile 的效果。 大佬解释一下这是什么情况?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2945 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 06:42 · PVG 14:42 · LAX 23:42 · JFK 02:42
    ♥ Do have faith in what you're doing.