[Solved] Is there a way to run in parallel completeley unrelated tasks in C/C++


You can try with OpenMP tasks. Open a parallel block and create two task blocks in it. Something like this:

#pragma omp parallel
{

   #pragma omp task {
      // hello world code 
   }
   #pragma omp task {
      // connect mysql
   }
}

Add the -fopenmp option to your compilation line. There might be better approaches than that, as it requires you putting all the code in the same code block. Anyway that’s quite an easy solution with minimal code addition.

1

solved Is there a way to run in parallel completeley unrelated tasks in C/C++