开发者

Simple Question on OpenMP

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 ();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜