-   LQ Articles Discussion (
-   -   DISCUSSION: Dynamic shared library loading (

Seedhom 02-21-2011 09:44 PM

DISCUSSION: Dynamic shared library loading
A new article entry has been added:

Dynamic shared library loading


Once you create a set of functions that you like to reuse in multiple programs, you typically build them into a library. The norm in Linux now has moved away from Static libraries (*.a) and more towards Shared Libraries (*.so). Shared libraries can either be linked-in at compile time from a specific location on the system using -l and -L flags or can be loaded dynamically while the program is executing. There are advantages and disadvantages for each of those 2 cases.

johnsfine 02-22-2011 03:12 PM

I only got as far as the second paragraph there before seeing something I think is a wrong enough direction that it deserves correction:


Assume I am writing a server with the purpose to serve applications to users. A typical case is when the user runs a client front-end application from which he makes requests to the server to execute other applications on the server side. The requested applications has to be available to the server in the form of a loadable objects. These loadable objects or shared libraries do not have to be predefined to the server before it starts, nor does the server need to know what they do once they are loaded. All the server needs to know is where these libraries are in its file system and the name of the function the user needs to call.
I can think of almost unlimited reasons why that should be done as separate processes launched by the server, and almost no reasons why you would consider doing it via .so files loaded into the server process address space.

I know it may be hard to think of an example that is realistic while still being simple enough to work through. But this choice of example gets the whole article off to a bad start.

Edit: Now I read the whole page there. That paragraph I complained about just distracts the reader and may cause some readers to go away before reading the useful parts. It doesn't really introduce what follows.

I don't think you even need that kind of ("what is it for") introduction to what follows. The example stands better alone without the lame introduction. If you do need an introduction, it should be a more reasonable one.

All times are GMT -5. The time now is 10:59 AM.