Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Looking for advice on QSharedMemory and threading
Forum Updated to NodeBB v4.3 + New Features

Looking for advice on QSharedMemory and threading

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 282 Views 2 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.
  • K Offline
    K Offline
    Kimon
    wrote on last edited by Kimon
    #1

    So I am setting out on a project to emulate multiple embedded software applications on a normal desktop PC to help with debugging the application specific code and get some early qualification of the functionality before deploying to the hardware for my company. Our end goal is also to have these emulated applications to interact with one another, so I'm trying to plan early in the design https://speedtest.vet/ https://vidmate.bid/ process to make this happen. I want each embedded application to be its own process and was thinking of having them communicate with one another using QSharedMemory.

    I don't have much experience with threading as well and need a little advice on how I should structure the threads that interact with the shared memory regions. So my question is if I have one emulated application interacting with 5 other applications that have bi-directional should I set up a QSharedMemory object for each direction between each app? So that would be 10 shared memory regions, 2 for each interface between the one app and it's interfacing app. If that's the case should I also dedicate a thread to each interface or should I have a two threads, one for reading all the shared memory regions and one for writing to all the shared memory regions? Also does QSharedMemory provide a mechanism to timeout if the thread wasn't able to acquire a lock after X attempts? I would like a feature like that in order to not delay getting data from other regions in case I put reading all shared memory regions in one thread.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      How are these deployed embedded softwares supposed to communicate with each other ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by Kent-Dorfman
        #3

        The purpose of shared memory IPC is the have one shared region and govern who controls it via a semaphore/mutex. multiple regions quickly becomes too complicated to manage. define the substance of the communications between the apps FIRST, then decide on what type of IPC you should use. Don't commit to a technology and then try to justify its use.

        I light my way forward with the fires of all the bridges I've burned behind me.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved