fork() system call and memory space of the process

前端 未结 6 423
一个人的身影
一个人的身影 2020-12-24 08:54

I quote \"when a process creates a new process using fork() call, Only the shared memory segments are shared between the parent process and the newly forked child process. C

6条回答
  •  误落风尘
    2020-12-24 09:43

    Yes, both processes are using the same address for this variable, but these addresses are used by different processes, and therefore aren't in the same virtual address space.

    This means that the addresses are the same, but they aren't pointing to the same physical memory. You should read more about virtual memory to understand this.

提交回复
热议问题