|
| You are here: Categories » Computers and technology » Linux
|
Shared libraries have several advantages over static libraries:
-
Linux shares the memory used for executable code among all the processes that use the shared library, so whenever you have more than one program using the same code, it is to your advantage, and to your users' advantage, to put the code in a shared library.
-
Because shared libraries save system memory, they can make the whole system work faster, especially in situations in which memory is not plentiful.
-
Because code in a shared library is not copied into the executable, only one copy of the library code resides on disk, saving both disk space and the computer's time spent copying the code from disk to memory when programs are run.
-
When bugs are found in a library, a shared library can be replaced by aversion that has the bugs fixed, instead of having to recompile every program that uses the library.
The cost exacted by these advantages is primarily complexity. The executable consists of several interdependent parts, and if you give a binary executable to someone who does not have a shared library that the executable requires, it will not run. A secondary cost is the time it takes when the program starts to find and load the shared libraries; this is generally negated because the shared libraries usually have already been loaded into memory for other processes, and so they do not have to be loaded from disk again when the new process is started.
Linux originally used a simplistic binary file format (actually, three variations on a simplistic binary file format) that made the process of creating shared libraries difficult and time-consuming. Once created, the libraries could not be easily extended in a backward-compatible way. The author of the library had to leave space for data structure expansion by hand-editing tables, and even that did not always work.
Now, the standard binary file format on almost every Linux platform is the modern, extensible Executable and Linking Format (ELF) file format. This means that on practically all Linux platforms, the steps you take to create and use shared libraries are exactly the same.
|
|
Leave a comment or ask a question
|
|
Total comments: 0
Disclaimer
- The e-articles directory is not responsible for any and all copyright infringements by writers and authors. If you suspect the information contained by this page for any copyright infringements, please contact us to investigate the issue
|
|
|
Short History of Ubuntu - Born in April 2004, a history of Ubuntu may seem premature. However, the last years have been full ones for Ubuntu. With its explosive growth, it is difficult even for those involv (more...)
Free Open source Software and GNU Linux - Free Software and GNUIn a series of events that have almost become legend through constant repetition, Richard M. Stallman created the concept of "free software" in 1983. Stallman grew (more...)
Choose an Ubuntu Version - The developers behind Ubuntu have worked to make the software as easy and flexible to install as possible. They understand that people will be installing Ubuntu on different types of computers (more...)
Customize Ubuntu Look and Feel - Changing the Background
To change the background of your desktop right-click it and select Change Desktop Background. Inside the dialog box that appears, choose yo (more...)
Configuring a Printer in Ubuntu - In the Linux world, configuring a printer has traditionally been a challenge. For years, newcomers to Linux have been repeatedly challenged and even bludgeoned with terms, commands, and phrases (more...)
Working with Windows from inside Ubuntu - Although the Linux platform offers an increasingly compelling platform for the desktop, there are sometimes situations when there is just no alternative application available. This is often the (more...)
Hardening the System with Bastille and Functions - Bastille is an open source program that facilitates the hardening of a Linux system. It performs many of the tasks, including downloading operating system updates and disabling services and po (more...)
Red Hat Linux Errata: Fixes and Advisories - Once your Red Hat system is live, you must make sure that the most current required Red Hat errata are installed.These errata include bug fixes, corrections, and updates to Red Hat products. (more...)
Locking Down Ports Under Linux - TCP/IP networks assign a port to each service, such as HTTP, Simple Mail Transfer Protocol (SMTP), and Post Office Protocol version 3 (POP3).This port is given a number, called a port number, (more...)
|
|
|