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

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


To use the MinGW-w64 with Win32 native threads you can install the mingw-std-threads headers.

As described on that page, this is because MinGW-w64 is a port of GCC, but GCC does not include any native thread support. Instead GCC installations typically implement threading via either gthreads or pthreads as a part of glibc. MinGW-w64 does not include a port of glibc. (Instead it uses a combination of the MSVC runtime, plus its own code to fill in holes).

Also as described on that page, recent versions of MinGW-w64 do include a Win32 port of pthreads ("winpthreads"), which explains why you can have threads work "out of the box" by selecting the "pthread" model from the MinGW-w64 installer.