Explore the execution flow of computer programs from start to finish.
The diagram shows the steps.
By double-clicking a program, a user is instructing the operating system to launch an application via the graphical user interface.
Once the execution request has been initiated, the operating system first retrieves the program’s executable file.
The operating system locates this file through the file system and loads it into memory in preparation for execution.
Most modern applications rely on a number of shared libraries, such as dynamic link libraries (DLLs).
The operating system is responsible for allocating space in memory.
After allocating memory, the operating system and execution environment (e.g., Java’s JVM or the .NET Framework) will initialize various resources needed to run the program.
The entry point of a program (usually a function named main
) is called to begin execution of the code written by the programmer.
In the Von Neumann architecture, the CPU executes instructions stored in memory.
Eventually, when the program has completed its task, or the user actively terminates the application, the program will begin a cleanup phase. This includes closing open file descriptors, freeing up network resources, and returning memory to the system.