Improved Shared Library Implementation
Original Publication Date: 2002-Jun-01
Included in the Prior Art Database: 2003-Jun-18
Disclosed is an improved mechanism for sharing modules across many address spaces in a single system. This invention achieves an advantage over the prior art by establishing the module sharing relationship only for the using address spaces involved, thus not taking away private area storage available to all other address spaces. Prior implementations of shared module sharing required that the module reside in a dedicated region of virtual storage that would be carved out of each address space in the system. This improvement to the state of the art does not require this, but only sets up the sharing relationship on demand. The following is the basic algorithm for this invention: 1) A program running in address space X loads a HFS resident system shared library object named /bin/abc . This causes the operating system to allocate a system configurable area of high end private area storage to be allocated from the address space X. This area is called the shared library region. The target program /bin/abc is then loaded into a Shared Library Data Space owned by the kernel address space and the target program is then mapped from the data space into an unused segment of the shared library region of address space X via a call to the IARVSERV SHARESEG RSM service. 2) The same program running in address space X subsequently loads a shared library program /bin/def. Since the shared library region is already allocated in address space X, the operating system loads the target program /bin/def into the Shared Library Data Space and the target program is then mapped from the data space into an used segment of the shared library region of address space X via a call to the IARVSERV SHARESEG RSM service. 3) A program running in address space Y loads a system shared library object /bin/abc . This causes the same shared library region area obtained in address space X to be obtained within address space Y. The shared library program /bin/abc is then located in the Shared Library Data Space and is mapped via a call to RSM's IARVSERV SHARESEG service into the shared library region of address space Y at the same address as it was originally mapped into address space X.