QThread + OpenMP

  • I would like to know if is possible to create a new QThread to a function called my_func(), and this new QThread start a OpenMP parallelization (creating another threads...).


    #pragma omp parallel for 
    for (int i = 0; i < 10000; i++) {
         // code here...

    So, the final result should be something like:
    Main Application: 1 Thread
    my_func(): 1 Thread (QThread)
    OpenMP: 12 Threads

    Total: 1 + 1 + 12 = 14 threads running

    Is this possible?

    Important: This solution must be cross-platform: Windows, Linux and Mac

  • Lifetime Qt Champion

    I don't see why it should not be possible.

Log in to reply