If a program runs two instances, unfortunately, the code of the two programs will not be shared, because the program code is loaded into the memory when the program is running. When the second program is started again, the system cannot The judgment will not determine whether the program is still the original program (if the program is updated or changed), so the program code will still be reloaded into another area of memory.
The shared expression of
code should be in 链接库, especially in 动态链接库. Because the library is designed to be dynamically linked, the program can determine the memory address where the code is located after running, which allows multiple programs to call the same piece of code.
If a program runs two instances, unfortunately, the code of the two programs will not be shared, because the program code is loaded into the memory when the program is running. When the second program is started again, the system cannot The judgment will not determine whether the program is still the original program (if the program is updated or changed), so the program code will still be reloaded into another area of memory.
The shared expression ofcode should be in
链接库
, especially in动态链接库
. Because the library is designed to be dynamically linked, the program can determine the memory address where the code is located after running, which allows multiple programs to call the same piece of code.