当前位置:网站首页>Static library vs shared library
Static library vs shared library
2022-07-03 11:11:00 【MrPeng1991】
- Static library
Before the shared library appeared , Public functions exist in the form of static libraries , Package multiple object files of the general function module , The program that uses it only needs to specify this library file when linking , The linker will extract the functional code used from this library and copy it to the target program , There is no need to recompile these general function codes every time .
Static library embodies a good idea of modularization , But with the development of computer industry , The static library gradually exposes two serious problems
- Large disk and memory space . Although the static library accelerates the compilation speed , It improves the efficiency of collaboration between different departments , But in the program linked by each static library , Will save a copy of the referenced general function code , And at runtime , Each copy will occupy the corresponding physical memory .
- Upgrading the version of the library is very troublesome , Once the public library is modified , Every program that references him needs to be relinked with the new version of the Library . In a scenario where libraries and applications are maintained by different companies or organizations , The upgrade work has become extremely complex , If there is bug Repair , All applications using this library need to be upgraded separately
- Shared library
To solve these two problems , Shared library technology came into being .
First , Applications that use shared libraries when compiling links , Do not copy the functions in the library to the target file , Only one reference is recorded in the target file , Mark the library function referred to , Until the program runs Only dynamic connector can locate the position of function code , Therefore, the volume of the generated executable program is significantly reduced .
secondly , Each shared library has only one copy in physical memory , Multiple applications will map the same executable file in their virtual address space , Therefore, it can save objective memory space .
This working mode of shared library greatly facilitates the upgrading of the Library , When the shared library releases a new version , Users only need to upgrade this shared library , All applications that use this library can automatically get the features in the new library or bug Repair , Instead of upgrading each application separately .
边栏推荐
猜你喜欢

8年测试工程师总结出来的《测试核心价值》与《0基础转行软件测试超全学习指南》

How to realize automatic testing in embedded software testing?

A simple method of adding dividing lines in recyclerview

硬 货 | 一改测试步骤代码就全写?为什么不试试用 Yaml实现数据驱动?

独家分析 | 关于简历和面试的真 相

游戏测试相关 测试一个英雄的技能(春招被问比较多的一道题)

历经一个月,终于拿到金蝶Offer!分享一下四面面经+复习资料

可以写进简历的软件测试电商项目,不进来get一下?

Cause: org. apache. ibatis. builder. Builderexception: error parsing SQL mapper configuration problem analysis

Probability theory: application of convolution in calculating moving average
随机推荐
Basic usage of sqlmap
Qt:qss custom qgroupbox instance
Clion debug
Latest sales volume of pinduoduo
8年测试总监的行业思考,看完后测试思维认知更深刻
软件测试(测试用例)编写之俗手、本手、妙手
Google Earth Engine(GEE)——GHSL 全球人口网格数据集250米分辨率
Qt:qss custom qlistview instance
MAUI Developer Day in GCR
行业唯一!法大大电子合同上榜36氪硬核科技企业
Qt:qss custom qmenubar instance
Exclusive analysis | truth about resume and interview
T5 attempt
8年测试工程师总结出来的《测试核心价值》与《0基础转行软件测试超全学习指南》
Typescript learning summary
Encapsulation attempt of network request framework of retro + kotlin + MVVM
文件上传下载测试点
12. Nacos server service registration of source code analysis of Nacos service registration
Software testing redis database
QT: QSS custom qtableview instance