c++11 and multi-threading

Oct 19, 2013 at 11:32pm
HI! I'm on an old computer running windows XP and I'm trying to check out the new multi-threading features of c++11, but Code::Blocks doesn't recognize the <thread> header file... is it my compiler, or do you have any suggestions on how I should proceed?

Thanks,
AeonFlux
Oct 19, 2013 at 11:53pm
I did have this problem. The reason is that due to gcc not having support for multithreading yet, the Win32 thread build of MinGW doesn't appear to support threading either. If you still want to try multithreading with MinGW, you would have to build MinGW as the POSIX-threads version.

Alternatively, you could probably download one at http://sourceforge.net/projects/mingwbuilds/, and then selecting the POSIX thread model.

Hope this helps!
Oct 20, 2013 at 3:39am
I downloaded the latest version of MinGW (the 32bits version, not the 64) and plugged it to Code::Blocks, and it seems to work!

I only tried std::thread::hardware_concurrency() though, but it reflected the resources of my computer, so I guess the whole <thread> header works as well... :-)

AeonFlux
Oct 20, 2013 at 7:45am
There's also 2 other compilers based on GNU GCC:

RubenVB's experimental 4.8.1 std-thread version
&
TDM GCC

TDM supports threads as of a recent update.
Oct 20, 2013 at 8:55am
closed account (S6k9GNh0)
There's also boost::thread which is mostly a portable non-optimized version of std::thread.
Oct 23, 2013 at 1:19am
yes TDM GCC is the one I tried with code::blocks
Topic archived. No new replies allowed.