Every time you "run a program," a
process is created ... which represents "an instance of a currently-running program." (That's what a 'process'
is.)
Each process "owns" all of the memory that is assigned to it, which it basically uses for one of
three purposes:
- "The stack," which is where local variables live.
- Global-variable storage, which is allocated once when the program starts and remains for the life of the program.
- "The heap," which is where dynamically allocated storage blocks (should there be any) come from.
This is true for
any modern operating system.
If a process wishes to
share memory with any other process, it must allocate a "shared memory segment," which (by suitable operating-system magic...) will be made to appear within the virtual-memory space of each process at the same time. Otherwise, the read/write storage of each process is absolutely isolated from all others, even when the (virtual...) addresses are the same.