GATE / CS ARCHIVE

GATE CSE 2003 / QUESTION 76

Startup cost of shared dynamic libraries

Operating Systems · Processes, Threads & System Calls · Full GATE CSE 2003 paper

GATE 2003, Q76 2 marks · MCQ
Report issue

Processes, Threads & System Calls

Question 76, GATE 2003: Which is NOT an advantage of shared, dynamically linked libraries over statically linked libraries?
A. Smaller executable files
B. Lower overall page-fault rate in the system
C. Faster program startup
D. Existing programs need not be relinked to benefit from newer library versions
Question 76, GATE 2003: Which is NOT an advantage of shared, dynamically linked libraries over statically linked libraries?
A. Smaller executable files
B. Lower overall page-fault rate in the system
C. Faster program startup
D. Existing programs need not be relinked to benefit from newer library versions
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Static linking copies required library code into each executable. Dynamic linking can leave that code in a separately loaded library, reducing executable size, so A is a conventional benefit.
2. Multiple processes can map the same read-only physical library pages. This reduces duplicated resident code and can reduce total memory pressure/page faults, the intended benefit in B.
3. A compatible replacement library may be used on the next load without rebuilding each application, explaining D; compatibility remains necessary.
4. Dynamic loading and symbol relocation/resolution add work at startup or first use. Faster startup is not a general advantage, so C is the requested exception. Actual cache and page-fault behavior still depends on workload.

Solution: Dynamic linking can keep library code out of the executable, share physical library pages among processes, and permit compatible library updates without relinking each application. It also introduces runtime loading, relocation, or symbol-resolution work. Faster program startup is therefore not the characteristic advantage over static linking, option C. The other listed benefits are the conventional shared-library benefits; actual page-fault and startup measurements can depend on caching and workload.

Original paper, page 11