Machine-translated by Google. Questions are authored in English.
Top

Discussion

Dynamic loading of a routine means that

  • A.the routine is loaded into memory only when it is first called
  • B.the routine is compiled at run time
  • C.the routine is copied to disk after use
  • D.the routine runs on a separate processor

Answer: C

Correct answer: the routine is loaded into memory only when it is first called

Dynamic loading defers bringing a routine into memory until it is first called. All routines are held on disk in a relocatable format; when one is called, the loader checks whether it is resident, loads and relocates it if not, and transfers control. The benefit is that unused routines are never loaded at all. Error-handling code, which may account for a large part of a program and is rarely executed, costs nothing unless an error occurs. It requires no support from the operating system - it is the responsibility of the program - though libraries are usually provided to make it convenient. It should be distinguished from dynamic linking, where the linking of a library is postponed until execution and a stub in the program locates the shared routine on first use. Dynamic linking allows a single copy of a library in memory to serve every process, and lets the library be patched without relinking every program that uses it. Both differ from static loading and linking, where everything is bound before execution begins.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.