Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Help for Example ; ThreadPool threads ready and waiting for new task



  • Hi,

    I have a Eigen matrix around 10milliyon each 1024xfloat32. So I want to create threadPool and evenly distribute the matrix for threds and wait a new job for doing calculation and send back the result which is for a certain conditions complied.

    function is :

            auto id = ( feat.row(x)- b_cmp ).squaredNorm();
            if (id < 0.5) {
                std::cout << std::endl << "Buldummm : " << x <<  "    " << distance <<std::endl;
                mutex1.lock();
                found_number.push_back(x);
                mutex1.unlock();
    
            }
    

    So calculation heavy . feat and b_cmp is Eigen Vectors.

    I need to create threadpool for above function each of them has own a pieces of huge data and ready to receive calculation matrix.

    I didt find a proper good ThreadPool example.

    is there any which is sutable such work ?

    I want to


  • Qt Champions 2019

    @RahibeMeryem Why do you want to create your own thread pool?
    Qt already does it for you: https://doc.qt.io/qt-5/qthreadpool.html


Log in to reply