openmp interoperability with std::thread, posix_threads, QThread, etc.

General OpenMP discussion
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help:
Posts: 1
Joined: Mon Feb 01, 2021 7:00 am

openmp interoperability with std::thread, posix_threads, QThread, etc.

Post by sena_at_s73 »

Hello OpenMP people,

What is the current state of interoperability of OpenMP with other threading frameworks? Can not find that in manuals. I searched also the OpenMP forum and found only that statement from 2009:
Neither OpenMP nor pthreads has defined the behavior when you use one
under the other. The OpenMP committee has on its long-term goals to
define the interaction of OpenMP threads with other threading models,
in particular Posix threads, but we haven't done that yet.
viewtopic.php?p=2556&sid=7825407ea75c54 ... 70a1#p2556

Is it still true or something was improved since that time?

Can I safely start, for example, two parallel std::thread/pthread and use OpenMP inside both of them? What about std::atomic usage? QThread?

Environment is: linux, x86, g++, c++17 at the moment.


We start using openmp for the relatively big project. First experience was quite positive except for some problems with threading. We want to extend the usage to other project parts, which incudes GUI apps with Qt QThread, networking with posix_threads etc. Another candidate is Intel's TBB, which I believe must not have any interoperability problems with std::thread.
Best regards, Sergey Spiridonov