jamesge commented on issue #720: 关于volatile关键字
URL: https://github.com/apache/incubator-brpc/issues/720#issuecomment-481981494
 
 
   
除非写硬件驱动碰到程序不可控的内存修改,一般用不到。当然权威答案可能得去问写编译器的,但一般例子中以两个线程共享一个变量云云举例,我觉得过度低估编译器了,这一点上和带gc的语言中的逃逸分析是有相似性的,编译器完全可以保守处理,或留至链接时优化。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to