c# - Which kinds of reordering optimizations do x86 CPUs do? -
in blog post, eric lippert says that:
i note on x86-based hardware particular reordering of writes never observed; cpus not perform optimization.
does mean x86 cpus not have of issues talked when discussing volatility , reordering of reads , writes, or mean in example cpu won't reorder?
what types of reorderings can happen in x86_64 cpu , under circumstances?
does mean x86 cpus not have of issues talked when discussing volatility , reordering of reads , writes, or mean in example cpu won't reorder?
it means stores not rearranged in x86 cpus; loads can still moved backward through. then, important understand x86 means. in context of post, means x86 , not derivatives. x86 oostore architecture enables far more memory reordering basic x86 implementation. can details here: http://en.wikipedia.org/wiki/memory_ordering
there plenty of examples around use case following:
- http://preshing.com/20120515/memory-reordering-caught-in-the-act/
- http://moodycamel.com/blog/2013/a-fast-lock-free-queue-for-c++
also, reordering cannot cross method call boundaries on architecture.
aside reordering, cpu architecture can cache values far more visible optimization. here use case optimization:
http://www.codeproject.com/articles/389730/the-unsung-hero-volatile-keyword-csharp-threading
Comments
Post a Comment