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. Data synchornization between thread during emit
Forum Updated to NodeBB v4.3 + New Features

Data synchornization between thread during emit

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 469 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.
  • N Offline
    N Offline
    nitks.abhinav
    wrote on last edited by
    #1

    Hi ,

    I have three threads , Main/GUI thread and two worker threads. data flow if from one worker thread to another and then to GU thread for that I am using Slot and Signal mechanism.

    I Can share the data in two ways, either define globally and the use mutex to synchronize OR
    I can pass the arguments in the slot and emit.

    My question is if I pass the arguments ans use queued connection , do these arguments gets copied to local buffer of event queue before getting copied to Slot functions local arguments?
    If not then reentrency can cause issues at senders side.

    Thanks

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Yes, in case of queued connections parameters passed by value or const reference are copied.

      1 Reply Last reply
      2

      • Login

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