About fork system call and global variables

前端 未结 5 1509
遥遥无期
遥遥无期 2021-01-15 04:57

I have this program in C++ that forks two new processes:

#include 
#include 
#include 
#include 

        
5条回答
  •  离开以前
    2021-01-15 05:52

    Pointers on modern systems doesn't correspond to actual hardware memory addresses. Rather the addresses maps to a virtual space managed by the operating system. Therefore the pointer addresses for two different processes can appear to be the same when they in reality are not.

提交回复
热议问题