Which of the following is NOT an advantage of using shared, dynamicall...
Refer Static and Dynamic Libraries In Non-Shared (static) libraries, since library code is connected at compile time, the final executable has no dependencies on the the library at run time i.e. no additional run-time loading costs, it means that you don’t need to carry along a copy of the library that is being used and you have everything under your control and there is no dependency.
View all questions of this test
Which of the following is NOT an advantage of using shared, dynamicall...
Introduction:
Shared, dynamically linked libraries and statically linked libraries are two different approaches to linking libraries with executable files. While both have their advantages, shared, dynamically linked libraries have certain benefits over statically linked libraries. This response explains why option 'C' is the correct answer, stating that faster program startup is not an advantage of using shared, dynamically linked libraries.
Explanation:
1. Smaller sizes of executable files:
- One of the advantages of using shared, dynamically linked libraries is that it results in smaller executable files.
- Statically linked libraries are directly included in the executable file, resulting in larger file sizes.
- On the other hand, shared libraries are loaded at runtime, allowing multiple programs to share the same library code, thereby reducing the overall file size.
2. Lesser overall page fault rate in the system:
- Another advantage of shared, dynamically linked libraries is that it leads to a lesser overall page fault rate in the system.
- When a program is statically linked with libraries, all the library code is loaded into memory along with the program.
- This can result in more page faults as the memory requirements increase, potentially impacting system performance.
- In contrast, shared libraries are loaded into memory only when required, reducing the overall page fault rate.
3. Existing programs need not be re-linked to take advantage of newer versions of libraries:
- This is another advantage of shared, dynamically linked libraries over statically linked libraries.
- When a program is statically linked with libraries, any updates or changes in the library code require re-linking and recompiling the entire program.
- However, with shared libraries, existing programs do not need to be re-linked to take advantage of newer versions of libraries.
- The updated shared library can simply be replaced, and the changes will be reflected in all programs that use that library.
4. Faster program startup:
- Contrary to the other advantages, faster program startup is not an advantage of using shared, dynamically linked libraries.
- When a program is linked with shared libraries, it incurs additional overhead during program startup.
- This is because the operating system needs to locate and load the required shared libraries into memory before executing the program.
- On the other hand, statically linked libraries are already included in the executable file, resulting in faster program startup as there is no need to locate and load external libraries.
Conclusion:
From the given options, the correct answer is option 'C' - faster program startup. While shared, dynamically linked libraries offer advantages such as smaller executable file sizes, a lesser overall page fault rate, and the ability to use newer library versions without re-linking programs, faster program startup is not one of them.
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).