Fork - same memory addresses?

前端 未结 5 796
青春惊慌失措
青春惊慌失措 2020-12-01 11:18

This is about C in Linux.

I have fork() in main() where I create 2 child processes. Then, in both child process a run the function ab

5条回答
  •  佛祖请我去吃肉
    2020-12-01 11:34

    Because of the virtual memory system, each child processes have its own variable with the same (virtual) address.

    The same virtual addresses won't point to the same physical location.

提交回复
热议问题