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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Shared sections in a DLL

Shared sections in a DLL

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • B Offline
    B Offline
    Bram van Kampen
    wrote on last edited by
    #1

    Hi, I am writing a DLL in which certain data have to be shared between all processes, and all threads accessing this DLL. This is put in a Shared section in the DLL. Do the sync objects such as CRITICAL_SECTION, MUTEX, etc. still work as expected? or are there caveats to be weary of. It is something that is very difficult so test or simulate! Regards,

    Bram van Kampen

    A 1 2 Replies Last reply
    0
    • B Bram van Kampen

      Hi, I am writing a DLL in which certain data have to be shared between all processes, and all threads accessing this DLL. This is put in a Shared section in the DLL. Do the sync objects such as CRITICAL_SECTION, MUTEX, etc. still work as expected? or are there caveats to be weary of. It is something that is very difficult so test or simulate! Regards,

      Bram van Kampen

      A Offline
      A Offline
      Afzaal Ahmad Zeeshan
      wrote on last edited by
      #2

      Quote:

      CRITICAL_SECTION, MUTEX, etc. still work as expected?

      Normally, they do test before releasing the libraries and SDKs, but it still depends on which runtime and its version are you using, as well as what is the deployment OS. Did you check the documentation? [About Synchronization | Microsoft Docs](https://docs.microsoft.com/en-us/windows/desktop/sync/about-synchronization). Also, please read this reference of synchronization to get to know a bit more about these topics, mutex, critical sections, etc. [Synchronization Functions | Microsoft Docs](https://docs.microsoft.com/en-us/windows/desktop/sync/synchronization-functions), there are remarks for each function and the type, you can review them. For example, here is the documentation and remarks for the function call that enables the program to enter the critical section, [EnterCriticalSection function | Microsoft Docs](https://docs.microsoft.com/en-gb/windows/desktop/api/synchapi/nf-synchapi-entercriticalsection)

      The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

      1 Reply Last reply
      0
      • B Bram van Kampen

        Hi, I am writing a DLL in which certain data have to be shared between all processes, and all threads accessing this DLL. This is put in a Shared section in the DLL. Do the sync objects such as CRITICAL_SECTION, MUTEX, etc. still work as expected? or are there caveats to be weary of. It is something that is very difficult so test or simulate! Regards,

        Bram van Kampen

        1 Offline
        1 Offline
        11917640 Member
        wrote on last edited by
        #3

        Place POD data to Dll shared section. Use named objects (mutex, event) to synchronize this shared data. Named synchronization objects should not be placed to the shared section. Interprocess Synchronization | Microsoft Docs[^]

        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