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 see signal slot Queue size?
Forum Updated to NodeBB v4.3 + New Features

How to see signal slot Queue size?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 1.3k 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.
  • R Offline
    R Offline
    RahibeMeryem
    wrote on last edited by
    #1

    I have many signal slot connection some of them Qt::BlockingQueuedConnection);
    other is normal etc..

    How I can see the received or waitim mesaages in the signal slot queue ? in size how many ?

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

      Hi,

      This is something 100% internal that is not exposed. You can't manipulate the queue either.

      What would you need that for ?

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

      R 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        This is something 100% internal that is not exposed. You can't manipulate the queue either.

        What would you need that for ?

        R Offline
        R Offline
        RahibeMeryem
        wrote on last edited by
        #3

        @SGaist

        I a sending frames and detected objects for other tasks and many signals queueu .

        some of if I dont use Blockingqueue some producer tasks send many frames and queue is growing I assume and the memory going crazy finally crash.

        This is why need to see which signal queue has how many messages and sizes.

        Christian EhrlicherC 1 Reply Last reply
        0
        • R RahibeMeryem

          @SGaist

          I a sending frames and detected objects for other tasks and many signals queueu .

          some of if I dont use Blockingqueue some producer tasks send many frames and queue is growing I assume and the memory going crazy finally crash.

          This is why need to see which signal queue has how many messages and sizes.

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @RahibeMeryem said in How to see signal slot Queue size?:

          messages and sizes

          No, this is why you need a proper producer - consumer pattern. This has nothing to do with Qt.

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

          R 1 Reply Last reply
          2
          • Christian EhrlicherC Christian Ehrlicher

            @RahibeMeryem said in How to see signal slot Queue size?:

            messages and sizes

            No, this is why you need a proper producer - consumer pattern. This has nothing to do with Qt.

            R Offline
            R Offline
            RahibeMeryem
            wrote on last edited by
            #5

            @Christian-Ehrlicher

            Of course we can say nothing related with Qt. Its just a thing that make life easier debugging.

            SGaistS 1 Reply Last reply
            0
            • R RahibeMeryem

              @Christian-Ehrlicher

              Of course we can say nothing related with Qt. Its just a thing that make life easier debugging.

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @RahibeMeryem your main issue is indeed your architecture. Using blocking queued connection is only needed in rare cases. The way you explain your issue looks like you are making use of too many of it and your are blocking your entire application.

              With more details, it will be easier to help find a proper fix.

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

              R 1 Reply Last reply
              0
              • SGaistS SGaist

                @RahibeMeryem your main issue is indeed your architecture. Using blocking queued connection is only needed in rare cases. The way you explain your issue looks like you are making use of too many of it and your are blocking your entire application.

                With more details, it will be easier to help find a proper fix.

                R Offline
                R Offline
                RahibeMeryem
                wrote on last edited by
                #7

                @SGaist

                Hi;

                MainWindow::MainWindow(QWidget *parent)
                    : QMainWindow(parent)
                    , ui(new Ui::MainWindow)
                {
                    ui->setupUi(this);
                
                    //***THREADS**//
                    thread_gstShowsources = new QThread;
                    gstshowframe = new GstShowFrame;
                    gstshowframe->moveToThread (thread_gstShowsources);
                
                
                
                    thread_stream_2 = new QThread;
                    stream_2 = new Stream_2;
                    stream_2->moveToThread(thread_stream_2);
                
                
                    thread_zmqreceiver  = new QThread;
                    zmqreceiver         = new ZmqReceiver;
                    zmqreceiver->moveToThread (thread_zmqreceiver);
                    qApp->processEvents();
                
                    thread_faceDetector = new QThread;
                    facedetector_scrfd = new FaceDetector;
                    facedetector_scrfd->moveToThread(thread_faceDetector);
                    thread_faceDetector->start();
                
                    thread_faceDetector_2 = new QThread;
                    facedetector_scrfd_2 = new FaceDetector;
                    facedetector_scrfd_2->moveToThread(thread_faceDetector_2);
                    thread_faceDetector_2->start();
                
                    thread_bytetracker = new QThread;
                    tracker = new BTracker;
                    tracker->moveToThread(thread_bytetracker);
                    thread_bytetracker->start();
                
                    thread_recognizer = new QThread;
                    recognizer = new RecognizeFaces;
                    recognizer->moveToThread(thread_recognizer);
                    thread_recognizer->start();
                
                    thread_dbfaceIndexer = new QThread;
                    databaseindexerWorker = new DatabaseIndexerWorker;
                    databaseindexerWorker->moveToThread(thread_dbfaceIndexer);
                    thread_dbfaceIndexer->start();
                
                
                    thread_dataLoaderDb = new QThread;
                    dataLoaderEigen     = new DataBaseLoaderToMemoryEigen;
                    dataLoaderEigen->moveToThread(thread_dataLoaderDb);
                    thread_dataLoaderDb->start();
                
                    _thread_dbArchiveFaces = new QThread;
                    _dbArchiveFaces     = new DbArchiveFaces;
                    _dbArchiveFaces->moveToThread(_thread_dbArchiveFaces);
                    _thread_dbArchiveFaces->start();
                
                    connect(_thread_dbArchiveFaces, &QThread::started,
                            _dbArchiveFaces, &DbArchiveFaces::startDatabase);
                
                    //TOOLS
                    //*** SIGNALS ** //
                    //PREPARE to Start
                
                
                    //STREAM Start
                    connect(gstshowframe, SIGNAL(workRequested()), thread_gstShowsources, SLOT(start()));
                    connect(thread_gstShowsources, &QThread::started, gstshowframe, &GstShowFrame::startWork);
                
                    connect(stream_2, SIGNAL(signal_workRequested()), thread_stream_2, SLOT(start()));
                    connect(thread_stream_2, &QThread::started, stream_2, &Stream_2::startWork);
                
                    //--START end
                
                    //Directly update Labels without face detection
                    //connect(gstshowframe, &GstShowFrame::signal_1_frameChanged, this, &MainWindow::update_frame_1 , Qt::BlockingQueuedConnection);
                    //qDebug() << "Signal connected to slot: signal_1_frameChanged -> update_frame_1";
                
                    //connect (stream_2, &Stream_2::signal_stream_2_frameChanged, this, &MainWindow::update_frame_2 , Qt::BlockingQueuedConnection);
                    // Diretly ends
                
                    //Sending to face detector Threads
                
                    connect(gstshowframe,
                            &GstShowFrame::signal_1_frameChanged,
                            facedetector_scrfd,
                            &FaceDetector::ProcessFrameFaces, Qt::BlockingQueuedConnection);
                
                
                
                    connect(stream_2,
                            &Stream_2::signal_stream_2_frameChanged,
                            facedetector_scrfd_2,
                            &FaceDetector::ProcessFrameFaces_2,
                            Qt::BlockingQueuedConnection);
                
                
                
                
                    connect(facedetector_scrfd,
                            &FaceDetector::signal_frameMetaData,
                            tracker,
                            &BTracker::updateTracks,
                            Qt::BlockingQueuedConnection);
                
                
                    connect(facedetector_scrfd_2,
                            &FaceDetector::signal_frameMetaData,
                            tracker,
                            &BTracker::updateTracks,
                            Qt::BlockingQueuedConnection);
                
                
                    connect(tracker,
                            &BTracker::signal_trackedFrameforMainwindowOnly,
                            this,
                            &MainWindow::_metaFrameReceived,
                            Qt::BlockingQueuedConnection);
                
                    //RECOGNIZER
                    connect(tracker,
                            &BTracker::signalTrackerWithIDFeatureExtract,
                            recognizer,
                            &RecognizeFaces::featureExtract,
                            Qt::BlockingQueuedConnection);
                
                    connect(tracker,
                            &BTracker::signal_trackedFaceMetaWithFrame,
                            this,
                            &MainWindow::addFaceChip);
                
                    connect(databaseindexerWorker , &DatabaseIndexerWorker::signal_indexedFace ,
                            this , &MainWindow::_faceIndexedImageShow );
                
                    //FACE ARCHIVER
                    connect(tracker,
                            &BTracker::signal_trackedFaceMetaWithFrame,
                            _dbArchiveFaces,
                            &DbArchiveFaces::addFacestoArchive);
                
                    connect(tracker,
                            &BTracker::signal_trackedFaceMetaWithFrameFullDBArchive,
                            _dbArchiveFaces,
                            &DbArchiveFaces::addFacestoArchive);
                
                
                    connect(recognizer , &RecognizeFaces::foundSuspect , this , &MainWindow::SuspectFound);
                
                    connect(gstshowframe,
                            &GstShowFrame::streamInfo,
                            this,
                            &MainWindow::updateStreamInfo);
                

                connection mechanism:

                gstshow reading frames from video mp4 and sending frame and stream meta to face detector.

                face detector doing its job and passing the frame.clone to the tracker (mOT objec track.)

                object tracking adding track id and choose best pose and send it to the feature extractor.

                fastest part is gstshow producing more frames than detector and feature extractor horse power .

                valgring didnt show me a memory leak. but sometime the memory increasing .

                also lates QtCreator 12 make some troubles to debug which I already shared with the team.

                jsulmJ 1 Reply Last reply
                0
                • R RahibeMeryem

                  @SGaist

                  Hi;

                  MainWindow::MainWindow(QWidget *parent)
                      : QMainWindow(parent)
                      , ui(new Ui::MainWindow)
                  {
                      ui->setupUi(this);
                  
                      //***THREADS**//
                      thread_gstShowsources = new QThread;
                      gstshowframe = new GstShowFrame;
                      gstshowframe->moveToThread (thread_gstShowsources);
                  
                  
                  
                      thread_stream_2 = new QThread;
                      stream_2 = new Stream_2;
                      stream_2->moveToThread(thread_stream_2);
                  
                  
                      thread_zmqreceiver  = new QThread;
                      zmqreceiver         = new ZmqReceiver;
                      zmqreceiver->moveToThread (thread_zmqreceiver);
                      qApp->processEvents();
                  
                      thread_faceDetector = new QThread;
                      facedetector_scrfd = new FaceDetector;
                      facedetector_scrfd->moveToThread(thread_faceDetector);
                      thread_faceDetector->start();
                  
                      thread_faceDetector_2 = new QThread;
                      facedetector_scrfd_2 = new FaceDetector;
                      facedetector_scrfd_2->moveToThread(thread_faceDetector_2);
                      thread_faceDetector_2->start();
                  
                      thread_bytetracker = new QThread;
                      tracker = new BTracker;
                      tracker->moveToThread(thread_bytetracker);
                      thread_bytetracker->start();
                  
                      thread_recognizer = new QThread;
                      recognizer = new RecognizeFaces;
                      recognizer->moveToThread(thread_recognizer);
                      thread_recognizer->start();
                  
                      thread_dbfaceIndexer = new QThread;
                      databaseindexerWorker = new DatabaseIndexerWorker;
                      databaseindexerWorker->moveToThread(thread_dbfaceIndexer);
                      thread_dbfaceIndexer->start();
                  
                  
                      thread_dataLoaderDb = new QThread;
                      dataLoaderEigen     = new DataBaseLoaderToMemoryEigen;
                      dataLoaderEigen->moveToThread(thread_dataLoaderDb);
                      thread_dataLoaderDb->start();
                  
                      _thread_dbArchiveFaces = new QThread;
                      _dbArchiveFaces     = new DbArchiveFaces;
                      _dbArchiveFaces->moveToThread(_thread_dbArchiveFaces);
                      _thread_dbArchiveFaces->start();
                  
                      connect(_thread_dbArchiveFaces, &QThread::started,
                              _dbArchiveFaces, &DbArchiveFaces::startDatabase);
                  
                      //TOOLS
                      //*** SIGNALS ** //
                      //PREPARE to Start
                  
                  
                      //STREAM Start
                      connect(gstshowframe, SIGNAL(workRequested()), thread_gstShowsources, SLOT(start()));
                      connect(thread_gstShowsources, &QThread::started, gstshowframe, &GstShowFrame::startWork);
                  
                      connect(stream_2, SIGNAL(signal_workRequested()), thread_stream_2, SLOT(start()));
                      connect(thread_stream_2, &QThread::started, stream_2, &Stream_2::startWork);
                  
                      //--START end
                  
                      //Directly update Labels without face detection
                      //connect(gstshowframe, &GstShowFrame::signal_1_frameChanged, this, &MainWindow::update_frame_1 , Qt::BlockingQueuedConnection);
                      //qDebug() << "Signal connected to slot: signal_1_frameChanged -> update_frame_1";
                  
                      //connect (stream_2, &Stream_2::signal_stream_2_frameChanged, this, &MainWindow::update_frame_2 , Qt::BlockingQueuedConnection);
                      // Diretly ends
                  
                      //Sending to face detector Threads
                  
                      connect(gstshowframe,
                              &GstShowFrame::signal_1_frameChanged,
                              facedetector_scrfd,
                              &FaceDetector::ProcessFrameFaces, Qt::BlockingQueuedConnection);
                  
                  
                  
                      connect(stream_2,
                              &Stream_2::signal_stream_2_frameChanged,
                              facedetector_scrfd_2,
                              &FaceDetector::ProcessFrameFaces_2,
                              Qt::BlockingQueuedConnection);
                  
                  
                  
                  
                      connect(facedetector_scrfd,
                              &FaceDetector::signal_frameMetaData,
                              tracker,
                              &BTracker::updateTracks,
                              Qt::BlockingQueuedConnection);
                  
                  
                      connect(facedetector_scrfd_2,
                              &FaceDetector::signal_frameMetaData,
                              tracker,
                              &BTracker::updateTracks,
                              Qt::BlockingQueuedConnection);
                  
                  
                      connect(tracker,
                              &BTracker::signal_trackedFrameforMainwindowOnly,
                              this,
                              &MainWindow::_metaFrameReceived,
                              Qt::BlockingQueuedConnection);
                  
                      //RECOGNIZER
                      connect(tracker,
                              &BTracker::signalTrackerWithIDFeatureExtract,
                              recognizer,
                              &RecognizeFaces::featureExtract,
                              Qt::BlockingQueuedConnection);
                  
                      connect(tracker,
                              &BTracker::signal_trackedFaceMetaWithFrame,
                              this,
                              &MainWindow::addFaceChip);
                  
                      connect(databaseindexerWorker , &DatabaseIndexerWorker::signal_indexedFace ,
                              this , &MainWindow::_faceIndexedImageShow );
                  
                      //FACE ARCHIVER
                      connect(tracker,
                              &BTracker::signal_trackedFaceMetaWithFrame,
                              _dbArchiveFaces,
                              &DbArchiveFaces::addFacestoArchive);
                  
                      connect(tracker,
                              &BTracker::signal_trackedFaceMetaWithFrameFullDBArchive,
                              _dbArchiveFaces,
                              &DbArchiveFaces::addFacestoArchive);
                  
                  
                      connect(recognizer , &RecognizeFaces::foundSuspect , this , &MainWindow::SuspectFound);
                  
                      connect(gstshowframe,
                              &GstShowFrame::streamInfo,
                              this,
                              &MainWindow::updateStreamInfo);
                  

                  connection mechanism:

                  gstshow reading frames from video mp4 and sending frame and stream meta to face detector.

                  face detector doing its job and passing the frame.clone to the tracker (mOT objec track.)

                  object tracking adding track id and choose best pose and send it to the feature extractor.

                  fastest part is gstshow producing more frames than detector and feature extractor horse power .

                  valgring didnt show me a memory leak. but sometime the memory increasing .

                  also lates QtCreator 12 make some troubles to debug which I already shared with the team.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @RahibeMeryem It sounds like you need synchronisation between producer and consumer. You could use a semaphore for this without using Qt signals/slots.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  SGaistS 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @RahibeMeryem It sounds like you need synchronisation between producer and consumer. You could use a semaphore for this without using Qt signals/slots.

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Beside the good point made @jsulm, since you know that your whole processing chain is slow, why are you reading the file faster than what your processing chain can do ?

                    Rather than pushing images as fast as the reader can, you should pull them as fast as your processing chain allows. The way you build your chain just complicate things for no real benefit.

                    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

                    • Login

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