Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statically linked libraries?

(a) Smaller sizes of executable

(b) Lesser overall page fault rate in the system

(c) Faster program startup

(d) Existing programs need not be re-linked to take advantage of newer versions of libraries

i don't have confusion on option a and d assuming that new libraries are backward compatible. i am confused between option b and c

  • $\begingroup$ Both (b) and (c) are byproducts of (a). $\endgroup$
    – codeR
    Apr 1 at 10:04
  • $\begingroup$ ( (e) DLLs do not spot spelling errors in post titles ) $\endgroup$
    – greybeard
    Apr 2 at 12:13

1 Answer 1


(d) is difficult. You need to assume that a new library version is 100% compatible with the old one. Here’s an example:

On macOS and iOS, if you use an enum in a switch statement you need to handle all cases. You can use “default”, but only if there are missing cases. Now a new library version adds an enum value.

Your code isn’t right, because it doesn’t handle the new case. If you used “default” then we don’t know if your code is still correct. That’s why the Swift language allows a special case for “unanticipated case that doesn’t exist in your current library”. That gives you a fighting chance as a developer.

(Apple also tends to keep new libraries backwards compatible. If there is a bug in version 10.5, and developers worked around that, then library version 11.2 where the bug is fixed will have checked during development whether apps used to 10.5 behaviour with a workaround still work. An app might break if there is a workaround for a bug, and the bug is gone. In that case the bug will remain for old apps. Hope your library does that).

When a new library is released, it is irresponsible not to test your application with the new version.

(a) is true if you have two applications on your computer linking with the shared library, otherwise only the position of the code changes. (b) is true every time two apps using the shared library are running. (c) is true when you launch the second or third app using the library.

  • $\begingroup$ can you explain why option b is true or where it might break? $\endgroup$ Apr 2 at 13:36
  • $\begingroup$ You don't have any advantage compared to a static library if only one application using it is running. But if 10 apps use the shared library, only one copy is loaded into memory instead of ten. And (c) the first of these ten apps doesn't launch faster. The second to tenth all do. $\endgroup$
    – gnasher729
    Apr 3 at 12:10
  • $\begingroup$ ok got it thanks $\endgroup$ Apr 3 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.