Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    2
    2
    76
    Loading More Posts
    • 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
      RahibeMeryem last edited by

      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

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @RahibeMeryem last edited by

        @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

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

        1 Reply Last reply Reply Quote 1
        • First post
          Last post