原文
| ||||||||||||||
| ||||||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=43456341
一篇Hacker News帖子链接到chipsandcheese.com上的一篇文章,讨论RDNA 4的“乱序”(Out-of-Order)内存访问。一位名为qntty的评论者对文章中声称单线程乱序内存读取很意外的说法表示困惑。他们认为,在单个线程内重新排序读取和写入操作是各种CPU架构中常见的做法,这与多线程编程中需要显式同步机制(如锁)来保证线程间顺序的既定原则形成对比。这位评论者认为AMD的说法令人惊讶,因为他们相信内存读取不应成为这种为了性能优化而重新排序的标准做法的例外。
| ||||||||||||||
| ||||||||||||||
![]() |
> A fundamental tenet of multithreaded programming is that you get no ordering guarantees between threads unless you make it happen via locks or other mechanisms. That's what makes multithreaded performance scaling work. AMD's slide took me by surprise because there's no reason memory reads should be an exception.
Isn't re-ordering of reads and writes, even within a single thread, standard in just about every CPU architecture?
reply