Java内存模型FAQ(二) 其他语言,像C++,也有内存模型吗?

原文:http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html 第二章

译者:Alex

大部分其他的语言,像C和C++,都没有被设计成直接支持多线程。这些语言对于发生在编译器和处理器平台架构的重排序行为的保护机制会严重的依赖于程序中所使用的线程库(例如pthreads),编译器,以及代码所运行的平台所提供的保障。

原文

Do other languages, like C++, have a memory model?

Most other programming languages, such as C and C++, were not designed with direct support for multithreading. The protections that these languages offer against the kinds of reorderings that take place in compilers and architectures are heavily dependent on the guarantees provided by the threading libraries used (such as pthreads), the compiler used, and the platform on which the code is run.

  • Trackback 关闭
  • 评论 (4)
    • 小败
    • 2014/04/23 6:48下午

    这是说有,还是说没有?

    • mama
    • 2021/07/28 5:58下午

    现在的C++20已经提供了这些支持

    • 2
    • 2021/08/03 12:32上午

    应该是说没有吧,不过你倒是直接回答呀。同时这个文章有些滞后了,现在 c++ 和 go 等都是有的

    • 开开
    • 2021/11/15 10:33上午

    这是有还是没有

return top