In virtual memory, can two different processes have the same address?

前端 未结 5 600
醉话见心
醉话见心 2021-01-30 07:50

This is an interview question I found in a website, the questions says: \"In virtual memory, can two different processes have the same address? When you answer \"No\" which is c

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 08:13

    1)

    • Same physical memory address at the same time: NO
    • Same virtual memory address at the same time: YES (each one maps to differnet physical address, or swap space)

    2) I think the debuggers don't access directly the other process debugged but communicates with the runtime in the debugged process to do that changes.

    That said, maybe the OS or processor instructions provide access/modify to other's memory access if you have the right. That doesn't mean it has the SAME address, it only says process 1 can say "access memory @address1 in Process2". Someone (processor / OS / runtime) will do that for process 1.

提交回复
热议问题