none
How dll is shared between processes RRS feed

  • Question

  • Hi ,

    I am willing to understand how dll is shared between processes? I know it is related to virtual memory. Also given that dll is loaded at same address and from same directory.

    How address translation happens for a shared dll from processes.

    Thursday, May 31, 2012 5:59 PM

Answers

  • DLLs will not be shared. If two processes use the same DLL each process has a own copy and the stored data of variabled declared in the DLL will not interfere the values of the dll of the other process.

    The only exception would be if you would create a shared data segment to change data across process boundaries.

    http://msdn.microsoft.com/en-us/library/h90dkhs0%28VS.80%29.aspx

    Thursday, May 31, 2012 6:15 PM
  • On 5/31/2012 1:59 PM, xyzam wrote:

    I am willing to understand how dll is shared between processes? I know it is related to virtual memory. Also given that dll is loaded at same address and from same directory.

    It's the same mechanism as the one used for memory-mapped files. The DLL image is mapped into the memory of each process.

    How address translation happens for a shared dll from processes.

    What address translation? Didn't you specifically postulate that "dll is loaded at same address"?


    Igor Tandetnik

    Thursday, May 31, 2012 6:52 PM

All replies

  • DLLs will not be shared. If two processes use the same DLL each process has a own copy and the stored data of variabled declared in the DLL will not interfere the values of the dll of the other process.

    The only exception would be if you would create a shared data segment to change data across process boundaries.

    http://msdn.microsoft.com/en-us/library/h90dkhs0%28VS.80%29.aspx

    Thursday, May 31, 2012 6:15 PM
  • I am not asking about sharing data between processes using dll. I am talking for dll code section. How translation happens to share the code.
    Thursday, May 31, 2012 6:19 PM
  • On 5/31/2012 1:59 PM, xyzam wrote:

    I am willing to understand how dll is shared between processes? I know it is related to virtual memory. Also given that dll is loaded at same address and from same directory.

    It's the same mechanism as the one used for memory-mapped files. The DLL image is mapped into the memory of each process.

    How address translation happens for a shared dll from processes.

    What address translation? Didn't you specifically postulate that "dll is loaded at same address"?


    Igor Tandetnik

    Thursday, May 31, 2012 6:52 PM
  • Hello,

    If you have any more questions, please feel free to post it.

    And if your question has been solved, please mark the answers and close the post.

    Thanks for your active participation in the MSDN Forum.

    Regards,

    Elegentin

    Wednesday, June 6, 2012 10:26 AM
    Moderator