源码

首页 » 归档 » 源码 » C 11引入了标准化的内存模型.这是什么意思…

C 11引入了标准化的内存模型.这是什么意思…


C 11引入了标准化的内存模型,但究竟是什么意思呢?它将如何影响C编程?

This article(由Gavin Clarke引用Herb Sutter)说,

The memory model means that C++ code
now has a standardized library to call
regardless of who made the compiler
and on what platform it’s running.
There’s a standard way to control how
different threads talk to the
processor’s memory.

“When you are talking about splitting
across different cores that’s
in the standard, we are talking about
the memory model. We are going to
optimize it without breaking the
following assumptions people are going
to make in the code,” Sutter said.

好吧,我可以在网上记住这个和类似的段落(因为我从出生以来就拥有自己的记忆模型:P),甚至可以发布作为其他人提出的问题的答案,但说实话,我并不完全明白这个.

C程序员以前用于开发多线程应用程序,那么如果它是POSIX线程,Windows线程或C 11线程,它又如何重要?有什么好处?我想了解低级细节.

我也觉得C 11内存模型在某种程度上与C 11多线程支持有关,因为我经常将这两者结合在一起.如果是,究竟是怎么回事?他们为什么要相关?

由于我不知道多线程的内部工作原理以及内存模型的含义,请帮助我理解这些概念. ?

(0)

本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/c-11yinrulebiaozhunhuadeneicunmoxing-zheshishenmeyisi.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9月 18, 2019 at 07:48 下午

热评文章