difference between dynamic loading and dynamic linking?

前端 未结 8 954
你的背包
你的背包 2020-12-02 12:16

Routine is not loaded until it is called. All routines are kept on disk in a re-locatable load format. The main program is loaded into memory & is execute

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 13:12

    We use dynamic loading to achieve better space utilization

    • With dynamic loading a program is not loaded until it is called.All routines are kept on a disk in a relocatable load format.The main program is loaded into memory and is executed.
    • When a routine needs to call another routine, the calling routine first checks to see whether has been loaded.If not , the relocatable linking loader is called to load the desired routine into memory and update program's address tables to reflect this change.Then control is passed to newly loaded routine

    Advantages

    1. An unused routine is never loaded .This is most useful when the program code is large where infrequently occurring cases are needed to handle such as error routines.In this case although the program code is large ,used code will be small.
    2. Dynamic loading doesn't need special support from O.S.It is the responsibility of user to design their program to take advantage of method.However, O.S can provide libraries to help the programmer

提交回复
热议问题