My understanding of copy-on-write is that “Everyone has a single, shared copy of the same data until it’s written, and then a copy is made”. Is a shared copy of the same data comprised of a heap and bss segment or only heap? Which memory segments will be shared, and is this dependent on the OS? Answer The OS can
Tag: copy-on-write
How is the code segment shared between processes in Linux?
I have read about the copy-on-write principle which occurs when a new process is being forked in Linux. I have also read about the fact that if multiple instances of one program are running at the same time, only one instance of the program code can be found in the memory. I was wondering whether this is a direct consequence