Using Shared Libraries

Slides:



Advertisements
Similar presentations
Operating Systems1 9. Linking and Sharing 9.1 Single-Copy Sharing –Why Share –Requirements for Sharing –Linking and Sharing 9.2 Sharing in Systems without.
Advertisements

Assembler/Linker/Loader Mooly Sagiv html:// Chapter 4.3 J. Levine: Linkers & Loaders
Linkage Editors Difference between a linkage editor and a linking loader: Linking loader performs all linking and relocation operations, including automatic.
Linking & Loading CS-502 Operating Systems
3. Loaders & Linkers1 Chapter III: Loaders and Linkers Chapter goal: r To realize how a source program be loaded into memory m Loading m Relocation m Linking.
Chapter 3 Loaders and Linkers
Loaders and Linkers CS 230 이준원. 2 Overview assembler –generates an object code in a predefined format »COFF (common object file format) »ELF (executable.
The Functions and Purposes of Translators Code Generation (Intermediate Code, Optimisation, Final Code), Linkers & Loaders.
1 Starting a Program The 4 stages that take a C++ program (or any high-level programming language) and execute it in internal memory are: Compiler - C++
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Loader- Machine Independent Loader Features
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
OBJECT MODULE FORMATS. The object module format we have employed as an educational device is called OMF (relocatable object format). It’s one of the earliest.
M.Frank LHCb/CERN - In behalf of the LHCb GAUDI team Data Persistency Solution for LHCb ã Motivation ã Data access ã Generic model ã Experience & Conclusions.
Improving Program Performance Function Visibility in z/TPF C++ Load Modules October 2, /2/20151American Express Public.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
M.Frank LHCb/CERN Using Shared Libraries ã The traditional way ã How to build shared images? ã Benefits ã Process configuration ã Fortran.
Writing a Run Time DLL The application loads the DLL using LoadLibrary() or LoadLibraryEx(). The standard search sequence is used by the operating system.
M.Frank LHCb/CERN Random Numbers in GAUDI ã Requirements ã Interface ã Usage.
Static Shared Library. Non-shared v.s. Shared Library A library is a collection of pre-written function calls. Using existing libraries can save a programmer.
CS412/413 Introduction to Compilers and Translators April 14, 1999 Lecture 29: Linking and loading.
Program Libraries 1. What is a program library? A library is a collection of implementations of behavior, written in terms of a language, that has a well-defined.
Tree-Structured Indexes. Introduction As for any index, 3 alternatives for data entries k*: – Data record with key value k –  Choice is orthogonal to.
Object Oriented Programming Some Interesting Genes.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 –Linkers.
Introduction to GCC Department of Radio Physics and Electronics ILug-Cal Introduction to GCC Department of Radio Physics and Electronics, Calcutta University.
Programs – Preprocessing, Compilation and Linking
Lecture 3 Translation.
DDC 2223 SYSTEM SOFTWARE DDC2223 SYSTEM SOFTWARE.
Assemblers, linkers, loaders
Chapter 14: Protection Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 9: Virtual Memory
SOFTWARE DESIGN AND ARCHITECTURE
GLAST Gaudi Review T. Burnett H.Kelly 10 Sept 02 Gaudi code review
The University of Adelaide, School of Computer Science
Linking & Loading.
Chapter 8 Main Memory.
USB Project (15th July) Ian Coulter.
Program Execution in Linux
CS-3013 Operating Systems C-term 2008
Main Memory Management
Lecture 5: Process Creation
The Assembly Language Level
Chapter 4 Link Based Implementations
Chapter 2: The Linux System Part 2
Chap. 8 :: Subroutines and Control Abstraction
Machine Independent Features
Chap. 8 :: Subroutines and Control Abstraction
Lesson Objectives Aims Understand how machine code is generated
Data Persistency Solution for LHCb
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Computer Organization and Design Assembly & Compilation
Threads Chapter 4.
The Assembly Language Level
Linking & Loading CS-502 Operating Systems
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
CSE 303 Concepts and Tools for Software Development
CSE 451: Operating Systems Winter 2009 Module 16 Linking, Loading and Process Startup Mark Zbikowski Gary Kimura 1.
Kanga Tim Adye Rutherford Appleton Laboratory Computing Plenary
CSC 497/583 Advanced Topics in Computer Security
Event Storage GAUDI - Data access/storage Framework related issues
Linking & Loading CS-502 Operating Systems
CSC 497/583 Advanced Topics in Computer Security
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Zhangxy Zhangxm Huangxt Dec 17 ,2003
ENERGY 211 / CME 211 Lecture 29 December 3, 2008.
Presentation transcript:

Using Shared Libraries The traditional way Is code equals to code? Some words about configuration. Benefits

The traditional way - comparison The past: 1 Executable Many object files/libraries, all linked into one executable at link time Gaudi: Very few object files/libraries linked in Process aquires it’s “personality” at run-time Dynamic linkage of images Execution of code within these images GAUDI M.Frank LHCb/CERN

Is Code equals to code? Usually most of the code is never executed Why carry the useless ballast with you? Example(s): Why link against Objy implementation, if I just want to copy a few events with ROOT to work at home? Why should a link after fixing a bug in a module? Why should I always link against reconstruction code, if it is unclear wether it will be ever called? The dependencies grow and grow and grow Lean component modules tend to have manageable dependencies GAUDI M.Frank LHCb/CERN

What type of code exists? Static libraries Code to be duplicated for each image Code which is aware of running in an executable or a shared image: Gaudi System class FactoryTable (wait for next slides) Basic Bootstrap IIDs, CLIDs, … GAUDI M.Frank LHCb/CERN

What type of code exists? Implicitly linked libraries Equivalent to tradition shared libraries Public implementation code All symbols are exported Base classes e.g. Converter, Service, ConversionSvc, MsgStream,… GAUDI M.Frank LHCb/CERN

What type of code exists? Explicitly linked libraries Loaded on demand using LoadLibrary(), dlopen(),… Component libraries Private implementation code No symbols are exported objdump -> no output (unless --dynamic-syms) Single entry point extern “C” std::list<const IFactory&>& getFactoryEntries() Access to all implemented factories GAUDI M.Frank LHCb/CERN

Benefits Process depends on configuration Modules become manageable PATH LD_LIBRARY_PATH Modules become manageable Minimize dependencies Upgrades are simple No link step is involved Efficient use of resources GAUDI M.Frank LHCb/CERN

Side Remarks Macros: GaudiDllCall, GaudiDllData, … used to export code on NT are gone Analyse archive library file directly: xdfol.exe Explicitly generate file with transfer vectors Fortran Shared libraries may not have unresolved refs to F77 code Force link into executable DLLs use routine pointers filled at image activation by analysing invoking executable file GAUDI M.Frank LHCb/CERN