How to see signal slot Queue size?
-
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 ?
-
Hi,
This is something 100% internal that is not exposed. You can't manipulate the queue either.
What would you need that for ?
-
Hi,
This is something 100% internal that is not exposed. You can't manipulate the queue either.
What would you need that for ?
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.
-
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.
@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.
-
@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.
Of course we can say nothing related with Qt. Its just a thing that make life easier debugging.
-
Of course we can say nothing related with Qt. Its just a thing that make life easier debugging.
@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.
-
@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.
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.
-
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.
@RahibeMeryem It sounds like you need synchronisation between producer and consumer. You could use a semaphore for this without using Qt signals/slots.
-
@RahibeMeryem It sounds like you need synchronisation between producer and consumer. You could use a semaphore for this without using Qt signals/slots.
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.