shared libraries ? - Programmer

This is a discussion on shared libraries ? - Programmer ; p> What are the advantages and dis-advantages to using a shared library p> in an OS design (like DLL's) ? Shared libraries and DLLs are not quite the same thing. Here are just some of the _many_ points that can ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: shared libraries ?

  1. shared libraries ?

    p> What are the advantages and dis-advantages to using a shared
    library
    p> in an OS design (like DLL's) ?

    Shared libraries and DLLs are not quite the same thing. Here are just
    some of the _many_ points that can be made on this subject:

    Applications programmers like shared libraries/DLLs because they can
    be used to enforce modularity and encapsulation. Applications
    programmers like DLLs because they provide simple polymorphism - the
    load-a-DLL-and-look-for-a-well-known-named-export mechanism. (This is
    one of the differences between DLLs and shared libraries.)
    Applications programmers like shared libraries/DLLs because they can
    enable simple application patching - the replace-with-a-new-version-of-
    the-DLL-with-the-bug-fixed mechanism. Applications programmers like
    shared libraries/DLLs because they provide a simple code re-use
    mechanism.

    Operating system designers don't like shared libraries and DLLs
    because they complicate process loaders. Operating system designers
    don't like DLLs specifically because there is a dearth of literature
    on the subject. Whilst operating systems design and implementation
    textbooks are happy to discuss at length such things as thread
    schedulers, filesystems, and memory management, the design and
    implementation of process loaders, where DLLs are involved, is a
    noticeable omission from pretty much all of them. Operating system
    designers don't like DLLs because they involve lots of subtleties,
    from traversing the load graph correctly (which OS/2 gets wrong),
    through module name matching (which has known, and differing,
    idiosyncracies on both OS/2 and Windows NT) and circular dependencies,
    to constraints upon what can be done in DLL initialization/cleanup
    functions (which has a long story in Windows NT).


  2. Re: shared libraries ?

    J de Boyne Pollard wrote:
    > p> What are the advantages and dis-advantages to using a shared
    > library
    > p> in an OS design (like DLL's) ?
    >


    The DLLs have at least one advantage. A lot of work in "system calls"
    is not "system" at all, but lots of setup and checking, and various
    other potentially usermode functionality. As implemented in OS/2
    (AIUI) the DLLs do the usermode stuff and then call the kernel only when
    absolutely required. This keeps a lot of cruft out the kernel.

    Unix basically does the same thing. I've heard it said that "the C
    library is the normal user interface to the kernel." (i.e., don't use
    syscalls).


+ Reply to Thread