c++ - Program execution steps -


I have a C ++ program that works fine, though it needs to run long but when it So I can continue to develop some parts of it. If I compile my program again, then it will replace the binary with a new one. Will it modify the behavior of the ongoing program? Or process and binary file are two different things when the program is started?

More generally, what are the steps for program execution?

On Linux, use the process memory mapping to map the executable file and text section of the shared library. If you can overwrite the executable file in the moving process memory, then it will affect the running process, however, writing in the mapped file for execution is prohibited - you get a "text file busy" error Land.

However, you can still compile the program again. If the compiler (in fact Linker) receives this error, then it removes the old executable file and creates a new one on Unix, if you remove a file that is in use, then the file content is actually disc Not to be removed from, only the reference to the directory entry is removed; The file is not completely deleted until all its references (directory entries, file descriptors, and memory mapping) are removed. Therefore the ongoing process is mapped to the old, unknown file. You can see it with the following performance:

  barmar @ dev: ~ $ ls -li testplip 229774 -rwxr-xr-x 1 burrarm Adam 4584 24 Apr 04:30 test ill @ dev : ~ $ ./testleep & amp; [1] 17538 Burmur @ Dev: ~ $ Touch Test.Q. Bullar @ dev: ~ $ to testlight cc testicles. -O Test Barmer @ Dev: ~ $ LS-LI Test 22 9 77-RWXR-XR-X1 Barmer Admin 4584 April 24 04:32 Testimple   

This code is changed to 22 9 774 to 22 9 7 , that a new file was created.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -