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. Signals / slots : Queued connection

Signals / slots : Queued connection

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k 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.
  • J Offline
    J Offline
    jhx76
    wrote on last edited by
    #1

    Hi everyone,

    We have a software that makes an heavy duty of signals/slots in queued connection.
    After the software run OK for some hours, we can note some "freezes" of the main thread which manages the Ui. After it, it crashes without any known reasons...

    We have around 60 different threads that emit and receive signals from/to Ui thread.

    Does the heavy duty of Queued connection signals/slots between a lot of threads and the Ui thread could produce some stability issues ?

    Thanks by advance,
    jhx

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MuldeR
      wrote on last edited by
      #2

      Well, it shouldn't. But if the main thread cannot process the signals as fast as they are added to the queue, the queue will keep on growing. I'm not sure what happens if the signal queue runs out of space. Might be that the other thread will simply be blocked until it can append the signal to the queue, might be that signal is discarded (unlikely) or might be that you just get an "out of memory" error (resulting in the crash subsequently).

      But it could also be that you simply make something wrong with event processing in your main thread. For example, the use of processEvent() can easily lead to stack overflows, if not used with extreme care. But in any case you should make a Debug build an check where exactly it crashes!

      --

      BTW: What about adding a separate "manager" thread, that receives and handles all the signals from the "worker" threads and only emits a signal to the "main" thread when absolutely necessary?

      My OpenSource software at: http://muldersoft.com/

      Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

      Go visit the coop: http://youtu.be/Jay...

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jhx76
        wrote on last edited by
        #3

        First, thank you very much for your response !

        About adding a separate “manager” thread, i think it is a good idea. It should narrow the Ui thread work. I will try.

        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