Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. COM
  4. How In-Process component(DLL) share by no. of clients....

How In-Process component(DLL) share by no. of clients....

Scheduled Pinned Locked Moved COM
comperformancequestion
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Siva Sankar Koyi
    wrote on last edited by
    #1

    Hi, Generally In-Process Component(DLL) will be loaded in to client Process(EXE),so that marshaling is not requied between your client call and DLL. I Have reffered many books, the DLL loads one place and it is shared by number of process this is how memory will be saved with DLL concept. But in COM, each client process it should load. how this situation will be handled ( means how the COM DLL will be called by number of Clients)?? could any body clarify me??? Thanks & Regards, Siva Sankar

    B 1 Reply Last reply
    0
    • S Siva Sankar Koyi

      Hi, Generally In-Process Component(DLL) will be loaded in to client Process(EXE),so that marshaling is not requied between your client call and DLL. I Have reffered many books, the DLL loads one place and it is shared by number of process this is how memory will be saved with DLL concept. But in COM, each client process it should load. how this situation will be handled ( means how the COM DLL will be called by number of Clients)?? could any body clarify me??? Thanks & Regards, Siva Sankar

      B Offline
      B Offline
      BiswaR
      wrote on last edited by
      #2

      Actually the dll will be loaded once by the first client. Subsequent client will check if that dll is present in memory or not. If that is present then they will use the same dll rather then loading it again. All this is taken care by the O.S. The kernel32.dll will keep track of whether the dll is loaded or not. If it is loaded then it will set some flag so that when a request to load that dll comes it will check that flag and load it accordingly.

      S 1 Reply Last reply
      0
      • B BiswaR

        Actually the dll will be loaded once by the first client. Subsequent client will check if that dll is present in memory or not. If that is present then they will use the same dll rather then loading it again. All this is taken care by the O.S. The kernel32.dll will keep track of whether the dll is loaded or not. If it is loaded then it will set some flag so that when a request to load that dll comes it will check that flag and load it accordingly.

        S Offline
        S Offline
        Siva Sankar Koyi
        wrote on last edited by
        #3

        Hi Biswa, Thanks for your reply, Suppose if Client1.exe calls DLL it will load in to Client1.exe process, same will happen if Client2.exe calls the same DLL. As per your reply DLL will be loaded in some common place, Which process DLL actually loads, if this is different than Client1.exe,Client2.exe process then marshalling is requied to call those DLL methods... As conclusion DLL should be loaded "Client1.exe" and "Client2.exe" processes,if not, could you please clarify me how this will be handled?? Thanks, Siva

        M 1 Reply Last reply
        0
        • S Siva Sankar Koyi

          Hi Biswa, Thanks for your reply, Suppose if Client1.exe calls DLL it will load in to Client1.exe process, same will happen if Client2.exe calls the same DLL. As per your reply DLL will be loaded in some common place, Which process DLL actually loads, if this is different than Client1.exe,Client2.exe process then marshalling is requied to call those DLL methods... As conclusion DLL should be loaded "Client1.exe" and "Client2.exe" processes,if not, could you please clarify me how this will be handled?? Thanks, Siva

          M Offline
          M Offline
          Milton Karimbekallil
          wrote on last edited by
          #4

          This is handled by memory paging. There will be only one copy of the dll in the physical memory. But both applications will be mapped to the same address space by paging. It does not mean that application A can write into the memory location of Application B and corrupt Application B. This vulnerability is prevented by a method called "Copy on Write". Thus if application A needs to write into the data memory of the dll, then it will take a copy of it and modify that copy so that it wont affect Application B. Look for memory paging for more info. rgds...mil10.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups