How is the seperation of multiple instances of the same project/program done, that means which mechanism seperates the data of two instances of the same project/program?
Edit: Examples:
greetings streight
An answer from the discussion above :
The OS assigns each program or an instance of a program a certain block of memory. Have you ever tried accessing random memory? Most of the time your program would crash. This is due to OS handling. If you access memory not assigned to you, the OS automatically crashes your program (security feature).
There is a separate memory for the program
and the memory that the program uses
. The memory given to the program to run (space required by the class/function name etc... ) is separate from any variables you would assign during runtime.
This is all assuming that your OS does support multiple processes executing in parallel - very old or very limited embedded systems may not even support this at all. A lot of boards you work on (in school) do not support something like this and you have to write it on your own.
When you call the same program with separate files, each file exists within it's own memory space. No, they are not labelled as such. Do not try to guess
what the names are after compilation. It just doesn't work.
why?
1)It's compiler dependent. Different compilers use different ways.
2)It's not human readable (unless your write the compiler yourself)(Correct me if I'm wrong)
The OS/compiler gives them a unique name (could be time dependent, os dependent or a a hundred other things). The programs do not know about each other and run in their own space.
Credit : @Hulk @Mohammad Ali Baydoun