How use mainThread in Qt to run a Big Data algorithm?



  • Hello my friend, i had a big data algorithm,that with out thread with corei5 cpu intel it work nice and realtime.
    i want to add interface UDP to read data and send to algorithm to calculate data,and again send a other ip on UDP.
    we use three thread in Qt:
    Thread One:
    Buffering Data that received from UDP......
    Thread Two:
    we used this thread for calculate algorithm......
    Thread Three:
    we send Data mining to UDP socket out..........
    but thread for algorithm is so slow, it can not work with speed of data received and after filling RAM it will crashed.........

    My Question is:
    i think mainThread is (main.cpp) is idle (my code is console without GUI),How i can used mainthread to running this algorithm or helo to other Thread Two that work faster....
    any idea?
    i had a function of algorithm that i used it, i can not create multithread of algorithm.........
    i want use any other idea........
    thanks

    int main(){
    .........
    return a.exec
    
    }
    

    my code QThread is same below link:
    http://www.bogotobogo.com/Qt/Qt5_QThreads_Creating_Threads.php

    http://www.bogotobogo.com/Qt/Qt5_QtConcurrent_RunFunction_QThread.php


  • Lifetime Qt Champion

    Hi,

    Did you determine what makes that thread slow ?

    Just moving the code around won't make it faster. Find the hot spots and see if you can improve the throughput there.

    Otherwise you might also need to have a more powerful machine to run your algorithms.



  • @SGaist thanks for reply i will examine more and will share result


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.