Solved QThread + OpenMP
-
I would like to know if is possible to create a new
QThread
to a function calledmy_func()
, and this newQThread
start a OpenMP parallelization (creating another threads...).Like:
#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 ThreadsTotal: 1 + 1 + 12 = 14 threads running
Is this possible?
Important: This solution must be cross-platform: Windows, Linux and Mac
-
I don't see why it should not be possible.