DYNAMIC LOADING AND DYNAMIC LINKING

DYNAMIC LOADING
  • Main Memory refers to a physical memory that is the internal memory to the computer. 
  • The word main is used to distinguish it from external mass storage devices such as disk drives. Main memory is also known as RAM.
  •  The computer is able to change only data that is in main memory. Therefore, every program we execute and every file we access must be copied from a storage device into main memory.
  • All the programs are loaded in the main memory for execution. Sometimes complete program is loaded into the memory, but sometimes a certain part or routine of the program is loaded into the main memory only when it is called by the program, this mechanism is called Dynamic Loading, this enhance the performance.
  • In dynamic loading, a routine of a program is not loaded until it is called by the program.
  • All routines are kept on disk in a relocatable load format.
  • The main program is loaded into memory and is executed.
  • Other routines methods or modules are loaded on request.
  • Dynamic loading makes better memory space utilization and unused routines are never loaded.
DYNAMIC LINKING:
  • Also, at times one program is dependent on some other program. In such a case, rather than loading all the dependent programs, CPU links the dependent programs to the main executing program when its required. This mechanism is known as Dynamic Linking.
  • Linking is the process of collecting and combining various modules of code and data into a executable file that can be loaded into memory and executed.
  • Operating system can link system level libraries to a program.
  • When it combines the libraries at load time, the linking is called static linking and when this linking is done at the time of execution, it is called as dynamic linking.
  • In static linking, libraries linked at compile time, so program code size becomes bigger whereas in dynamic linking libraries linked at execution time so program code size remains smaller.

No comments:

Post a Comment