I have two function which are not related to each other for example:
int add(int num)
{
int sum=0;
for(i=0;i<num;++i)
sum+=i;
return sum;
}
int mul(int num)
{
int mul=1;
for(int i=1;i<num;++i)
mul * i;
return mul;
}
and I am suing them as follow:
auto x=add(100);
auto m=mul(200);
cout<<a<< " " <<m<<endl;
How can I run them in parallel using OpenMP? I know that I can run them in parallel if I create a new thread and run one of the functions in that thread and implement a sync mechanizim to make sure that both threads finisshes by time that cout is called.
Also I know that I can use openMP parallel for for my loops, but assume that it is not there.