java thread visibility

后端 未结 1 974
孤街浪徒
孤街浪徒 2020-12-19 10:57

When I read the \"java concurrency in practice\" c03, I was confused by the following program:

public class NoVisibility { 
    private stat         


        
相关标签:
1条回答
  • 2020-12-19 11:32

    All the reason is I'm too lucky?

    Not necessarily. It will depend on your processor architecture and JVM implementation too. That's one of the problems with subtle memory model issues: they can be very hard to reproduce in the wild.

    0 讨论(0)
提交回复
热议问题