Monday, October 13, 2008

Dynamic Loading

As all we know the an entire program and the data of all the process is always kept in physical memory for the process to execute this data.Here,in this situation the size of process is limited to the size of the physical memory.Here to obtain better space utilization we use dynamic loading.In dynamic loading a routine is never loaded into memory until it is called.All routines are kept on the disk in a relocatable load format.

First of all main program is loaded into memory and executed,now after this when a routine needs to call another routine,the calling routine first checks whether the other routine has been loaded.If the other routine is not loaded,then the relocatable linking loader is called to load the desired routine into memory and to update the program's address table to reflect this change. Then after this control is transferred to the newly loaded routine.The advantage of dynamic loading is that an unused routine is never loaded.This method is particularly useful when large amount of codes are needed to handle infrequently occurring cases such as error routines.

In all these cases the total program size may be large and the portion that is used may be much smaller.Dynamic Loading does not require any special support from the hardware or from the operating system.It is the responsibility of programmers to design their programs to take advantage of such a method.Sometimes operating system also helps the programmer by providing library routines to implement dynamic loading.

1 comments:

Mahi said...

Check out Blogcytes Blog Advertising for free link exchange and opportunities to write about advertisers ready to buy blog reviews.

Log on to BlogCytes today to start earning from updating your idle blogs.