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. How to change the signal priority to multithread
Forum Updated to NodeBB v4.3 + New Features

How to change the signal priority to multithread

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

    I define a child thread, which have two slot functions triggered by two different signals from main UI thread.

    Assuming the two slot functions are fA, fB and the two signals are sA, sB. In genaral, sA was emitted in cycles. After a time, many sA was inserted the event queue of the child thread, the sB was emitted and insert the tail of the queue. The child thread will execute the fA and then fB according to the principle of coming later.

    But I want to call the fB slot function immediately if the sB signal is emitted, regardless of sA was emitted prior to sB.

    无标题.png

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @limy said in How to change the signal priority to multithread:

      But I want to call the fB slot function immediately if the sB signal is emitted, regardless of sA was emitted prior to sB.

      How should this work, even without threads - you emitted sA, so the thread is executing the slot for A. Now you're emitting sB - should the thread simply stop executing the slot for A? This is nonsense.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      5

      • Login

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