Does OpenMP work in a MFC application?

2019-04-15 06:55发布

问题:

I would like to improve performance of our MFC application with parallel processing. Of course, I've searched OpenMP and MFC over internet. Most of posts are about struggling with integrating OpenMP into MFC app. That led this question.

Is it possible to use OpenMP for a MFC application?

UPDATE: It seems that Currency Runtime can do what OpenMP does for MFC. But I would like to still make sure about the question above.

回答1:

I can't see any reason why MFC should stop you using openMP.

Although OMP generally works best for small optomised routines performing a few operations in a loop. You probably shouldn't be allocating and destroying MFC objects in a paralleled loop, you also need to be careful of any non-thread safe MFC operations.

And read 32 OpenMP Traps For C++ Developers it's very easy to make a small mistake and have OMP not work



标签: c++ mfc openmp