After forking, are global variables shared?
No and yes. No, they are not shared in any way which is visible to the programmer; the processes can modify their own copies of the variables independently and they will change without any noticable effect on the other process(es) which are fork() parents, siblings or descendents. But yes, the OS actually does share the … Read more