home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / bsd / 10210 < prev    next >
Encoding:
Text File  |  1992-12-14  |  4.1 KB  |  89 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!spooky!witr
  3. From: witr@rwwa.COM (Robert Withrow)
  4. Subject: Re: Shared lib benchmarks, and experiences
  5. Message-ID: <1992Dec14.231025.12627@rwwa.COM>
  6. Sender: news@rwwa.COM (News Administrator)
  7. Nntp-Posting-Host: spooky
  8. Reply-To: witr@rwwa.com
  9. Organization: R.W. Withrow Associates
  10. References: <veit.724064215@du9ds3> <1gdnvrINNp80@life.ai.mit.edu> <1992Dec12.235116.7484@rwwa.COM> <1giendINNgku@life.ai.mit.edu>
  11. Distribution: usa
  12. Date: Mon, 14 Dec 1992 23:10:25 GMT
  13. Lines: 74
  14.  
  15. In article <1giendINNgku@life.ai.mit.edu>,
  16.  ericy@hal.gnu.ai.mit.edu (Eric Youngdale) writes:
  17.  
  18. |     Finally some people are wondering why we are discussing the linux
  19. | shared libraries on the comp.unix.bsd list.  The original question had to do
  20. | with shared experiences, and some people naturally were wondering how we do
  21. | this under linux. 
  22.  
  23. And I think that this discussion is good to have in C.U.B. so that the
  24. technical tradeoffs of shared librarys get a good airing...
  25.  
  26. | >  1) The two librarys must have identical ``assigned'' addresses, and
  27. | >  2) The two librarys must be substantially identical.
  28. |     The first point is correct.  I should point out that there is no reason
  29. | why we cannot have two different libraries assigned to the same address - you
  30. | just will not be able to use both at the same time in the same process.
  31.  
  32. The reason why I bring this up is that I suspect that it is difficult to
  33. assign ``compatible'' ``assigned'' addresses except in the case where the
  34. libraries are ``substantially identical''.  For example, if the latter library
  35. has twice as many entrypoints as the former, this is likely to be a difficult,
  36. problem and probably has no general solution.
  37.  
  38. | The second one depends upon how you define "substantially".
  39. [...]
  40. | As a rule of thumb, as long as you can provide identical
  41. | assigned addresses, you can generate plug compatible libraries.  The
  42. | limitations have less to do with the design of the library itself, but have
  43. | more to do with the tools that we have available to ensure that the various
  44. | addresses remain the same from one version to the next.
  45.  
  46. This is the caveat that worries me.  How do you handle the following
  47. situations?
  48.  
  49.   1) Second library has (many) more entrypoints than former library.
  50.   2) The ordering of the entrypoints in the objects is different.
  51.   3) There is changed inter- and intra-calling relationships between
  52.      routines in this and other libraries.
  53.   4) What about run-time library loading, as is done with resolvers
  54.      on SVR4.
  55.  
  56. | As I recall the biggest drawbacks to the dynamic linking were
  57. | the need for a new assembler and linker, the need for more extensive kernel
  58. | mods, larger binaries and more overhead to load a program. 
  59.  
  60. Let's handle these in turn.
  61.  
  62. 1) Need for new assembler and linker:  If you mean that you need a compilation
  63. system that can generate PI code, then yes, you need these.  Since the GCC
  64. system generates PI code, I don't see why this is a problem.
  65.  
  66. If you mean that you have to extensively modify the compilation system
  67. in other ways, this is not correct.  You can handle all the needed functions
  68. in the CRTL startup code.  You may want to have the linker do other things
  69. for efficiency reasons, but it is not otherwise required.
  70.  
  71. 2) Kernel mods.  Dynamic shared libs can be done without kernel mods
  72. depending on how code space is protected.  Or you can use a mmap primitive
  73. to speed things up.  Or you can add additional kernel code to make it 
  74. all more efficient.  Extensive kernel mods are not *required*.
  75.  
  76. 3) Larger binaries:  Not significantly, and, perhaps, not at all.  It depends
  77. on the details.  This should be weighed against the benefits.
  78.  
  79. 4) More overhead to load a program.  This also depends on the details.
  80. On my SVR4 system the additional time varys depending on whether the library
  81. has already been accessed by another process.  For X programs, which access
  82. about a dozen shared librarys, the time seems to be swamped by other factors,
  83. such as widget creation.  I don't notice it.
  84.  
  85. -- 
  86.  Robert Withrow, Tel: +1 617 598 4480, Fax: +1 617 598 4430, Net: witr@rwwa.COM
  87.  R.W. Withrow Associates, 21 Railroad Ave, Swampscott MA 01907-1821 USA
  88.