Is this rule about volatile usage strict?

前端 未结 8 1790
梦毁少年i
梦毁少年i 2020-12-11 20:36

I\'ve seen this sentence:

the general rule is, if you have variables of primitive type that must be shared among multiple threads, declare those

8条回答
  •  感动是毒
    2020-12-11 21:09

    Before you take the article you linked to first too seriously, you might want to read another. In a later posting on Usenet, Andrei later admitted that parts of the original article were just plain wrong, and pointed to this one as giving a more realistic view of things (though note that the link he gives to it there seems to have gone stale).

提交回复
热议问题