FACTOID # 18: Alaska spends more money per capita on elementary and secondary education than any other state.
 
 Home   Encyclopedia   Statistics   States A-Z   Flags   Maps   FAQ   About 
   
 
WHAT'S NEW
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Library (computer science)
Illustration of an application which may use libvorbisfile.so to play an Ogg Vorbis file.
Illustration of an application which may use libvorbisfile.so to play an Ogg Vorbis file.

In computer science, a library is a collection of subprograms used to develop software. Libraries contain "helper" code and data, which provide services to independent programs. This allows code and data to be shared and changed in a modular fashion. Some executables are both standalone programs and libraries, but most libraries are not executables. Executables and libraries make reference known as links to each other through the process known as linking, which is typically done by a linker. Image File history File links library diagram released under Creative Commons 2. ... Image File history File links library diagram released under Creative Commons 2. ... This page is about the audio compression codec. ... Computer science is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. ... In computer science, a subroutine (function, procedure, or subprogram) is a sequence of code which performs a specific task, as part of a larger program, and is grouped as one, or more, statement blocks; such code is sometimes collected into software libraries. ... Computer software (or simply software) refers to one or more computer programs and data held in the storage of a computer for some purpose. ... In computing, a module is a software entity that groups a set of (typically cohesive) subprograms and data structures. ... Figure of the linking process, where object files and static libraries are assembled into a new library or executable. ...


Most modern operating systems (OS) provide libraries that implement the majority of system services. Such libraries have commoditized the services a modern application expects an OS to provide. As such, most code used by modern applications is provided in these libraries. An operating system (OS) is an essential software program that manages the hardware and software resources of a computer. ...

Contents


Overview

Libraries may be classified by how they are shared, how they are linked, and when they are linked.


Dynamic linking

Dynamic linking means that the data in a library is not copied into a new executable or library at compile time, but remains in a separate file on disk. Only a minimal amount of work is done at compile time by the linker-- it only records what libraries the executable needs and the index names or numbers. The majority of the work of linking is done at the time the application is loaded (loadtime) or during the execution of the process (runtime). The necessary linking code, called a loader, is actually part of the underlying operating system. At the appropriate time the loader finds the relevant libraries on disk and adds the relevant data from the libraries to the process's memory space. Figure of the linking process, where object files and static libraries are assembled into a new library or executable. ... In computing, a loader is a program that performs the functions of a linker program and then immediately schedules the resulting executable program for action (in the form of a memory image), without necessarily saving the program as an executable file. ... In computer science, run time (with a space, though often its spelled without one) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... In computing, a loader is a program that performs the functions of a linker program and then immediately schedules the resulting executable program for action (in the form of a memory image), without necessarily saving the program as an executable file. ... An operating system (OS) is an essential software program that manages the hardware and software resources of a computer. ...


Some operating systems can only link in a library at loadtime, before the process starts executing; others may be able to wait until after the process has started to execute and link in the library just when it is actually referenced (i.e. during runtime). The latter is often called "delay loading". In either case, the library is called a dynamically linked library. This term is sometimes shortened to "dynamic link library" or DLL, but this last initialism is most common in Microsoft Windows environments where dynamic libraries use the filename extension .dll. See DLL. In computer science, run time (with a space, though often its spelled without one) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... Microsoft Windows is a series of popular proprietary operating environments and operating systems created by Microsoft for use on personal computers and servers. ... A filename extension is an extra set of (usually) alphanumeric characters that is appended to the end of a filename to allow computer users (as well as various pieces of software on the computer system) to quickly determine the type of data stored in the file. ... Dynamic-link library (DLL), also referred to as dynamic link library (without the hyphen), is Microsofts implementation of the shared library concept in the Microsoft Windows operating systems. ...


Dynamically linked libraries date back to at least MTS (the Michigan Terminal System), built in the late 1960s. ("A History of MTS", Information Technology Digest, Vol. 5, No. 5) MTS is an operating system for IBM System/360 and its successors that was developed jointly by the following institutions: University of Michigan Wayne State University Simon Fraser University University of Alberta University of British Columbia Rensselaer Polytechnic Institute Durham University University of Newcastle-upon-Tyne Popular programs developed for...


Relocation

One wrinkle that the loader must handle is that the location in memory of the actual library data is not knowable until after the executable and all dynamically linked libraries have been loaded into memory, since the memory locations used depend on which specific DLLs have been loaded. It is not possible to store the absolute location of the data in the executable, nor even in the DLL. Relocation is the process of replacing references to symbols with actual addresses during fragment preparation and it is typically done by the Linker. ...


It would theoretically be possible to examine the program at load time and replace all references to data in the libraries with pointers to the appropriate memory locations once all DLLs have been loaded, but this method would consume unacceptable amounts of either time or memory. Instead, most dynamic library systems link a symbol table with blank addresses into the program at compile time. All references to code or data in the library pass through this table, the import directory. At load time the table is modified with the location of the library code/data by the loader/linker.


The library itself contains a table of all the methods within it, known as entry points. Calls into the library "jump through" this table, looking up the location of the code in memory, then calling it. This introduces overhead in calling into the library, but the delay is usually so small as to be negligible.


Locating libraries at runtime

Dynamic linkers/loaders vary widely in functionality. Some depend on explicit paths to the libraries being stored in the executable. Any change to the library naming or layout of the filesystem will cause these systems to fail. More commonly, only the name of the library (and not the path) is stored in the executable, with the operating system supplying a system to find the library on-disk based on some algorithm.

  • Most Unix-like systems have a "search path" specifying file system directories in which to look for dynamic libraries. On some systems, the default path is specified in a configuration file; in others, it's wired into the dynamic loader. Some executable file formats can specify additional directories in which to search for libraries for a particular program. It can usually be overridden with an environment variable, although that's disabled for setuid and setgid programs, so that a user can't force such a program to run arbitrary code. Developers of libraries are encouraged to place their dynamic libraries in places in the default search path. On the downside this can make installation of new libraries problematic, and these "known" locations quickly become home to an increasing number of library files, making management more complex.
  • Microsoft Windows will check the registry to determine the proper place to find an ActiveX DLL, but for standard DLLs it will check the current working directory; the directory set by SetDllDirectory(); the System32, System, and Windows directories; and finally the PATH environment variable.
  • OpenStep used a more flexible system, collecting up a list of libraries from a number of known locations (similar to the PATH concept) when the system first starts. Moving libraries around causes no problems at all, although there is a time cost when first starting the system.

One of the largest disadvantages of dynamic linking is that the executables depend on the separately stored libraries in order to function properly. If the library is deleted, moved, or renamed, or if an incompatible version of the DLL is copied to a place that is earlier in the search, the executable could malfunction or even fail to load. On Windows this is commonly known as DLL hell. A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification. ... This article is about the computing term. ... Configuration files are used to configure the initial settings for some computer programs. ... An executable or executable file, in computer science, is a file whose contents are meant to be interpreted as a program by a computer. ... Environment variables are a set of dynamic values that can affect the way running processes will behave. ... Setuid is a UNIX term, and is short for Set User ID. Setuid, also sometimes referred to as suid, is an access right flag that can be assigned to files and directories on a UNIX based operating system. ... In computing, the Windows registry is a database which stores settings and options for the operating system for Microsoft Windows 32-bit versions and Windows Mobile. ... In programming, the Component Object Model (COM), also known as ActiveX, is a Microsoft technology for software components. ... Environment variables are a set of dynamic values that can affect the way running processes will behave. ... OpenStep is an open object-oriented API specification for an object-oriented operating system that uses any modern operating system as its core, principally developed by NeXT. It is important to recognize that while OpenStep is an API specification, OPENSTEP (all capitalized) is a specific implementation of this OpenStep developed... DLL hell is a colorful term given to any problem based on a difficulty in managing Dynamically Linked Libraries (DLLs) installed on a particular copy of an operating system. ...


Dynamic loading

Dynamic loading is a subset of dynamic linking where a dynamically linked library loads and unloads at run-time on request. The request to load such a dynamically linked library may be made implicity at compile-time, or explicity by the application at run-time. Implicit requests are made by adding library references, which may include file paths or simply file names, to an object file at compile-time by a linker. Explicit requests are made by applications using a run-time linker API. In computer science, runtime describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ... In computer science, runtime describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ...


Most operating systems that support dynamically linked libraries also support dynamically loading such libraries via a run-time linker API. For instance, Microsoft Windows uses the API functions LoadLibrary, LoadLibraryEx, FreeLibrary and GetProcAddress with Microsoft Dynamic Link Libraries; POSIX based systems, including most UNIX and UNIX-like systems, use dlopen, dlclose and dlsym. Some development systems automate this process. In computer science, runtime describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... API may refer to: In computing, application programming interface In petroleum industry, American Petroleum Institute In education, Academic Performance Index This page concerning a three-letter acronym or abbreviation is a disambiguation page — a navigational aid which lists other pages that might otherwise share the same title. ... Microsoft Windows is a series of popular proprietary operating environments and operating systems created by Microsoft for use on personal computers and servers. ... Dynamic-link library (DLL), also referred to as dynamic link library (without the hyphen), is Microsofts implementation of the shared library concept in the Microsoft Windows operating systems. ... To meet Wikipedias quality standards, this article or section may require cleanup. ...


Remote libraries

Another solution to the library issue is to use completely separate executables (often in some lightweight form) and call them using a remote procedure call (RPC). This approach maximizes operating system re-use: the code needed to support the library is the same code being used to provide application support and security for every other program. Additionally, such systems do not require the library to exist on the same machine, but can forward the requests over the network. A remote procedure call (RPC) is a protocol that allows a computer program running on one computer to cause a subroutine on another computer to be executed without the programmer explicitly coding the details for this interaction. ...


The downside to such an approach is that every library call requires a considerable amount of overhead. RPC calls are generally very expensive, and often avoided where possible. Nevertheless this approach has become popular in a number of domain-specific areas, notably client-server systems and application servers such as Enterprise JavaBeans. An application server is a server computer in a computer network dedicated to running certain software applications. ... The Enterprise JavaBeans specification is one of the several Java APIs in the Java 2 Platform, Enterprise Edition. ...


Shared library

In addition to being loaded statically or dynamically, libraries are also often classified according to how they are shared among programs. Dynamic libraries almost always offer some form of sharing, allowing the same library to be used by multiple programs at the same time. Static libraries, by definition, cannot be shared; they are linked into each program.


The shared library term is slightly ambiguous, because it covers at least two different concepts. First, it is the sharing of code located on disk by unrelated programs. The second concept is the sharing of code in memory, when programs execute the same physical page of RAM, mapped into different address spaces. It would seem that the latter would be preferable, and indeed it has a number of advantages. For instance on the OpenStep system, applications were often only a few hundred kilobytes in size and loaded almost instantly; the vast majority of their code was located in libraries that had already been loaded for other purposes by the operating system. There is a cost, however; shared code must be specifically written to run in a multitasking environment, and this has effects on performance. OpenStep is an open object-oriented API specification for an object-oriented operating system that uses any modern operating system as its core, principally developed by NeXT. It is important to recognize that while OpenStep is an API specification, OPENSTEP (all capitalized) is a specific implementation of this OpenStep developed...


RAM sharing can be accomplished by using position independent code as in Unix, which leads to a complex but flexible architecture, or by using normal, ie. not position independent code as in Windows and OS/2. These systems make sure, by various tricks like pre-mapping the address space and reserving slots for each DLL, that code has a great probability of being shared. Windows DLLs are not shared libraries in the Unix sense. The rest of this article concentrates on aspects common to both variants. In computing, position independent code (PIC) is object code that can execute at different locations in memory. ... Wikibooks has more about this subject: Guide to Unix Unix or UNIX is a computer operating system originally developed in the 1960s and 1970s by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ... OS/2 is an obsolete operating system created by Microsoft and IBM and later developed by IBM exclusively. ...


In most modern operating systems, shared libraries can be of the same format as the "regular" executables. This allows two main advantages: first, it requires making only one loader for both of them, rather than two. The added complexity of the one loader is considered well worth the cost. Secondly, it allows the executables also to be used as DLLs, if they have a symbol table. Typical executable/DLL formats are ELF and Mach-O (Unix) and PE (Windows). In Windows, the concept was taken one step further, with even system resources such as fonts being bundled in the DLL file format. The same is true under OpenStep, where the universal "bundle" format is used for almost all system resources. An operating system (OS) is an essential software program that manages the hardware and software resources of a computer. ... In computing, the Executable and Linkable Format (ELF, formerly called Extensible Linking Format) is a common standard file format for executables, object code, shared libraries, and core dumps. ... Mach-O, short for Mach object file format, is a file format for executables and object code. ... The Portable Executable (PE) format is a file format for executables, object code, and DLLs, used in 32-bit and 64-bit versions of Windows operating systems. ...


The term DLL is mostly used on Windows and OS/2 products. On Unix platforms, the term shared library is more commonly used. This is technically justified in view of the different semantics. More explanations are available in the position independent code article. OS/2 is an obsolete operating system created by Microsoft and IBM and later developed by IBM exclusively. ... In computing, position independent code (PIC) is object code that can execute at different locations in memory. ...


In some cases, an operating system can become overloaded with different versions of DLLs, which impedes its performance and stability. Such a scenario is known as DLL hell. DLL hell is a colorful term given to any problem based on a difficulty in managing Dynamically Linked Libraries (DLLs) installed on a particular copy of an operating system. ...


Object Libraries

Dynamic linking developed during the late 1980s and was generally available in some form in most operating systems by the early 1990s. It was during the same period that object-oriented programming (OOP) was first making its way into the programming market. OOP requires additional information that traditional libraries don't supply; in addition to the names and entry points of the code located within, they also require a list of the objects they depend on. This is a side-effect of one of OOP's main advantages, inheritance, which means that the complete definition of any method may be defined in a number of places. This is more than simply listing that one library requires the services of another, in a true OOP system, the libraries themselves may not be known at compile time, and vary from system to system. MacGyver is one of the symbols of 1980s The 1980s decade refers to the years from 1980 to 1989, inclusive. ... The 1990s decade refers to the years from 1990 to 1999, inclusive. ... In computer science, object-oriented programming, OOP for short, is a computer programming paradigm. ... In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ...


At the same time another common area for development was the idea of multi-tier programs, in which a "display" running on a desktop computer would use the services of a mainframe or minicomputer for data storage or processing. For instance, a program on a GUI-based computer would send messages to a minicomputer to return small samples of a huge dataset for display. Remote procedure calls already handled these tasks, but there was no standard RPC system. Mainframes (often colloquially referred to as big iron) are large and expensive computers used mainly by government institutions and large companies for legacy applications, typically bulk data processing (such as censuses, industry/consumer statistics, ERP, and bank transaction processing). ... Minicomputer (colloquially, mini) is a largely obsolete term for a class of multi-user computers which make up the middle range of the computing spectrum, in between the largest multi-user systems (traditionally, mainframe computers) and the smallest single-user systems (microcomputers or personal computers). ... A remote procedure call (RPC) is a protocol that allows a computer program running on one computer to cause a subroutine on another computer to be executed without the programmer explicitly coding the details for this interaction. ...


It was not long before the majority of the mini/mainframe vendors were working on projects to combine the two, producing an OOP library format that could be used anywhere. Such systems were known as object libraries, or distributed objects if they supported remote access (not all did). Microsoft's COM is an example of such a system for local use, DCOM a modified version that support remote access.


For some time object libraries were the "next big thing" in the programming world. There were a number of efforts to create systems that would run across platforms, and companies competed to try to get developers locked into their own system. Examples include IBM's System Object Model (SOM/DSOM), Sun Microsystems' Distributed Objects Everywhere (DOE), NeXT's Portable Distributed Objects (PDO), Digital's ObjectBroker, Microsoft's Component Object Model (COM/DCOM), and any number of CORBA-based systems. International Business Machines Corporation (IBM, or colloquially, Big Blue; NYSE: IBM) is a computer technology firm headquartered in Armonk, NY, USA. The company, which was founded in 1888 and incorporated June 15, 1911, manufactures and sells computer hardware, software, infrastructure services, hosting services, and consulting services. ... The System Object Model is an object-oriented shared library system developed by IBM. A distributed version based on CORBA, DSOM allowed objects on different computers to communicate. ... Sun Microsystems, Inc. ... Distributed Objects Everywhere (DOE) was a long-running Sun Microsystems project to build a distributed computing environment based on the CORBA system in the back end and OpenStep as the user interface. ... The NeXT logo, designed by Paul Rand. ... Portable Distributed Objects, or PDO, is a programming API for creating object oriented code that runs anywhere on a network of computers. ... A digital system is one that uses numbers, especially binary numbers, for input, processing, transmission, storage, or display, rather than a continuous spectrum of values (an analog system) or non-numeric symbols such as letters or icons. ... ObjectBroker <programming> A distributed object system from DEC based on the CORBA standard. ... Component Object Model (COM) is a Microsoft platform for software componentry introduced by Microsoft in 1993. ... In computing, Common Object Request Broker Architecture (CORBA) is a standard for software componentry, created and controlled by the Object Management Group (OMG). ...


In the end, it turned out that OOP libraries were not the next big thing. With the exception of Microsoft's COM and NeXT's (now Apple Computer) PDO, all of these efforts have since ended. Apple Computer, Inc. ...


The jar (file format) is mainly used for object libraries in the Java programming language. It consists of (compressed) classes in bytecode format and is loaded by a java virtual machine or special class loaders. In computing, a Jar file (short for Java archive) is a ZIP file used to distribute a set of Java classes. ... Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1990s. ...


Naming

  • GNU/Linux, Solaris and BSD variants: libfoo.a and libfoo.so files are placed in folders like /lib, /usr/lib or /usr/local/lib. The filenames always start with lib, and end with .a (archive, static library) or .so (shared object, dynamically linked library), with an optional interface number. For example libfoo.so.2 is the second major interface revision of the dynamically linked library libfoo. Old Unix versions would use major and minor library revision numbers (libfoo.so.1.2) while contemporary Unixes will only use major revision numbers (libfoo.so.1). Dynamically loaded libraries are placed in /usr/libexec and similar directories. The .la files sometimes found in the library directories are libtool archives, not useable by the system as such.
  • Mac OS X and upwards: The system inherits static library conventions from BSD, and can use .so-style libraries (with the .dylib suffix instead). Most libraries, however, are dynamic, and placed inside of special directories called "bundles," which wrap the library's required files and metadata. For example a library called "My Neat Library" would be implemented in a bundle called "My Neat Library.framework".
  • Microsoft Windows: *.LIB files are statically linkable libraries and *.DLL files are dynamically linkable libraries. The interface revisions are encoded in the files, or abstracted away using COM-object interfaces.

GNU (pronounced ) is a free software operating system. ... Linux (also known as GNU/Linux) is a computer operating system. ... This article or section contains information that has not been verified and thus might not be reliable. ... BSD redirects here; for other uses see BSD (disambiguation). ... Wikibooks has more about this subject: Guide to Unix Unix or UNIX is a computer operating system originally developed in the 1960s and 1970s by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ... GNU Libtool is a GNU programming tool from the GNU build system used for creating portable software libraries. ... This article or section does not cite its references or sources. ... BSD redirects here; for other uses see BSD (disambiguation). ... Microsoft Windows is a series of popular proprietary operating environments and operating systems created by Microsoft for use on personal computers and servers. ... Component Object Model (COM) is a Microsoft platform for software componentry introduced by Microsoft in 1993. ...

See also

In computer science, a Dynamic Library, also refered to as a Dynamically Linked Library, is a computer library that implements the concept of dynamic linking. ... Figure of the linking process, where object files and static libraries are assembled into a new library or executable. ... In computing, a loader is a program that performs the functions of a linker program and then immediately schedules the resulting executable program for action (in the form of a memory image), without necessarily saving the program as an executable file. ... Dynamic-link library (DLL), also referred to as dynamic link library (without the hyphen), is Microsofts implementation of the shared library concept in the Microsoft Windows operating systems. ... In computer science, object file or object code is an intermediate representation of code generated by a compiler after it processes a source code file. ... Prebinding is a method for optimizing Mach-O executables. ... Static libraries are programming libraries which are linked into programs at compile-time. ... A computer programming paradigm in which one writes small bits of code to accomplish a common task. ...

External links


  Results from FactBites:
 
Library (computer science) - definition of Library (computer science) in Encyclopedia (2303 words)
Libraries are distinguished from executables in that they are not independent programs; rather, they are "helper" code that provides services to some other independent program.
A linker is a separate utility which takes one or more libraries and object files (which are previously generated by a compiler or an assembler) and produces an actual executable file.
This form of library is typically used for plug-in modules and interpreters needing to load certain functionality on demand.
  More results at FactBites »

 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m