Prayer

在一般中寻求卓越
posts - 1256, comments - 190, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Shared libraries and shared memory

Posted on 2018-11-28 15:25 Prayer 阅读(113) 评论(0)  编辑 收藏 引用 所属分类: LINUX/UNIX/AIX
https://www.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.genprogc/shared_libs_mem.htm

This topic provides information about the operating system facilities provided for sharing libraries and memory allocation.

The operating system provides facilities for the creation and use of dynamically bound shared libraries. Dynamic binding allows external symbols referenced in user code and defined in a shared library to be resolved by the loader at run time.

The shared library code is not present in the executable image on disk. Shared code is loaded into memory once in the shared library segment and shared by all processes that reference it. The advantages of shared libraries are:

  • Less disk space is used because the shared library code is not included in the executable programs.
  • Less memory is used because the shared library code is only loaded once.
  • Load time may be reduced because the shared library code may already be in memory.
  • Performance may be improved because fewer page faults will be generated when the shared library code is already in memory. However, there is a performance cost in calls to shared library routines of one to eight instructions.

The symbols defined in the shared library code that are to be made available to referencing modules must be explicitly exported using an exports file, unless the -bexpall options is used. The first line of the file optionally contains the path name of the shared library. Subsequent lines contain the symbols to be exported.


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理