Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 21994

Does MinGW-w64 support std::thread out of the box when using the Win32 threading model?

$
0
0

I have opted for the Win32 threading model when installing the MinGW-w64 toolchain, after reading that it provides better performance than the POSIX counterpart. I am not qualified for benchmarking this claim myself, but here's a source for it.

At first I thought this option would only affect the inner workings of the GCC runtime, while not preventing me from using C++11 threads in my code, based on this answer and this comment by fellow user rubenvb.
However, this doesn't seem to be the case. std::thread support appears to be non-existent in this MinGW-w64 installation.

I am invoking g++ from the command line with no options other than -std=c++11.

At this point I'm not sure if:

  • rubenvb was mistaken, and it's actually necessary to install MinGW-w64 under the POSIX threading model in order to compile my code which depends on the C++11 thread library, or;
  • I completely misunderstood it all, or;
  • std::thread is actually supported in my scenario, it's just not intuitive.

I reinforce the "out of the box" part in the title. There exists a library called mingw-std-threads, as presented in this answer. However, as a third-party option, it is not relevant to this question.

So, as of today (May 2016), does MinGW-w64 nativelly support std::thread depending code, when installed with the Win32 internal threading model?


Viewing all articles
Browse latest Browse all 21994

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>