两个CPU机器上的两个不同进程可以同时访问相同的RAM地址

发布于 2024-12-05 11:25:11 字数 125 浏览 1 评论 0原文

如果我有一台带有两个 cpu 的计算机,每个 cpu 运行一个进程,那么它们都希望使用相同的虚拟地址“x”运行。它们是否会在物理地址空间中获得相同的位置? (因为它们是同时的,并且不知道另一个也请求空间并且可能意外地获得相同的物理地址)

If I have a computer with two cpu's which run a process each, they both want to take place on the run with the same virtual address 'x'. Could that happen that they get the same place in the physical address space? (Because they are simultaneous, and don't know that the other asked for space too and could accidentally get same physical address)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空袭的梦i 2024-12-12 11:25:11

不,有一些内存原语允许对内存进行原子访问。这允许多个 cpu 进行协调。如果没有这种原语,两个 cpu 将无法协调它们的工作。

No, there are memory primitives which allow atomic access to memory. This allows multiple cpus to coordinate. Without this sort of primitive, two cpus would not have the ability to coordinate their efforts.

此岸叶落 2024-12-12 11:25:11

地址空间的分配是协调的,以便两个进程不会偶然共享其部分地址空间。操作系统可能在进程之间共享其地址空间的只读部分,典型的例子是程序本身。

Allocation of address spaces is coordinated so that two processes do not share part of their address space by chance. The OS might share between processes read only portions of their address spaces, the typical example being the program itself.

懵少女 2024-12-12 11:25:11

答案是“不”。有一些机制可以阻止它。

http://www.ece.cmu.edu/~ece548/handouts/19coher .pdf 有一些不错的幻灯片,在相对较高的水平上解决了该主题 - 但随附的文本可能会更有洞察力。

The answer is 'No'. There are mechanisms that prevent it.

http://www.ece.cmu.edu/~ece548/handouts/19coher.pdf has some nice slides that address the topic at a relatively high level - but the accompanying text would probably be more insightful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文