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

前端 未结 5 523
醉话见心
醉话见心 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条回答
  •  旧时难觅i
    2021-01-30 08:24

    Each process has a address space of 4GB in a 32 bit system. Where is this real 4GB is managed by the OS. So in principle 2 different process can have same addresses that is local to the process.

    Now when one process has to read the memory of another process it has to either communicate with the other process (memory mapped files etc.,) or use the Debug apis like OpenProcess/ReadProcessMemory.

    What I am sure is one process cannot directly go and read the virtual memory of other process atleast in Win32 without the help of the OS.

提交回复
热议问题