简体   繁体   English

x86 CPU可以进行哪些重新排序优化?

[英]Which kinds of reordering optimizations do x86 CPUs do?

In his blog post , Eric Lippert says that: 埃里克·利珀特(Eric Lippert)在他的博客文章中说:

I note that on x86-based hardware this particular reordering of writes is actually never observed; 我注意到,在基于x86的硬件上,实际上从未观察到这种特定的写入重新排序; those CPUs do not perform this optimization. 这些CPU不执行此优化。

Does this mean that x86 CPUs do not have any of the issues that are talked about when discussing volatility and reordering of reads and writes, or does he mean that only in this example the CPU won't reorder? 这是否意味着x86 CPU在讨论易失性和读写的重新排序时没有讨论任何问题,还是仅在此示例中CPU不会重新排序?

What types of reorderings can happen in an x86_64 CPU and under which circumstances? x86_64 CPU可以在什么情况下发生什么类型的重新排序?

Does this mean that x86 CPUs do not have any of the issues that are talked about when discussing volatility and reordering of reads and writes, or does he mean that only in this example the CPU won't reorder? 这是否意味着x86 CPU在讨论易失性和读写的重新排序时没有讨论任何问题,还是仅在此示例中CPU不会重新排序?

It means that stores are not rearranged in x86 CPUs; 这意味着不会在x86 CPU中重新排列存储 loads can still be moved backward through. 负载仍然可以向后移动。 Then, it is important to understand what x86 means. 然后,重要的是要了解x86的含义。 In the context of this post, it means only x86 and not its derivatives. 在本文的上下文中,它仅表示x86,而不是其派生词。 The x86 oostore architecture enables far more memory reordering than the basic x86 implementation. 与基本的x86实现相比,x86 oostore体系结构实现了更多的内存重新排序。 You can get all the details here: http://en.wikipedia.org/wiki/Memory_ordering 您可以在此处获取所有详细信息: http : //en.wikipedia.org/wiki/Memory_ordering

There are plenty of examples around for this use case like the following: 此用例周围有很多示例,如下所示:

Also, reordering cannot cross method call boundaries on this architecture. 同样,重新排序不能跨越此体系结构上的方法调用边界。

Aside from reordering, just about any CPU architecture can cache values which is a far more visible optimization. 除了重新排序之外,几乎所有CPU架构都可以缓存值,这是一个更为明显的优化。 Here is a good use case for this optimization: 这是此优化的一个好用例:

http://www.codeproject.com/Articles/389730/The-unsung-hero-Volatile-keyword-Csharp-threading http://www.codeproject.com/Articles/389730/The-unsung-hero-Volatile-keyword-Csharp-threading

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Web部署项目是否适用于x86构建配置 - Do Web Deployment Projects work with x86 build configuration 当我更改C#COM dll的签名时,为什么必须从x86到msil再回到x86 - Why do I have to go from x86 to msil back to x86 when I change signature of C# COM dll 我是否需要同时安装.Net SP2的64位和x86版本? - Do I need to install both the 64-bit *and* x86 version of .Net SP2? 如何使用不同的程序集(x86和ARM)构建UWP库? - How do you build UWP library with different assemblies (x86 and ARM)? 如何为为 x86 CPU 配置的项目获取正确的 SQLite 程序集? - How do I get the proper SQLite assemblies for a project configured for x86 CPU? 为什么我在win x86中无法通过VS代码调试我的项目? - Why do I can't debug my project by VS code in win x86? 在 C# 中进行按位运算时,除了 x64 或 x86 之外,我还需要考虑 CPU 吗? - When doing bitwise operations in C#, do I ever have to consider the CPU besides x64 or x86? 如何使nunit-console在程序集的\\ bin \\ Debug \\中而不是\\ bin \\ x86 \\ Debug中显示? - How do I make nunit-console look in \bin\Debug\ rather than \bin\x86\Debug for assemblies? 带有XBAP的x86 TargetPlatform - x86 TargetPlatform with XBAPs 哪个ngen在x64系统上用于x86 app? - Which ngen to use for x86 app on x64 system?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM