Say we have a serial application that stops normally for a while 'till a completely independent function is computed. How can one use OpenMP to spawn that function only to a thread and only开发者_如何学Go printf its result when it ends? [without stopping the main application]
EDIT: Can it be done if the independent function is run inside the main app?
You can use parallel sections.
#pragma omp parallel sections
{
#pragma omp section
YourMainApp ();
#pragma omp section
YourIndepFunction ();
}
精彩评论