mingw support for c++11 concurrency

Does anybody know when mingw will support the concurrency parts of c++11?

Currently you cannot use std::thread or std::async. These are available in g++ on Linux.

my g++ version: 4.7.0
I see you're attempting to compile under MinGW. Try:

#include <thread>
#include <iostream>

int main()
std::cout << "glib doesn't have gthreads on my platform\n";

when it is defined, MinGW will support std::thread :]

I believe the reason it doesn't support threads yet is that no version of std::thread has been made that uses the win API, I don't know when they plan to implement it though.

If you use G++ under cygwin(linux..emulator? I'm hesitant saying emulator, but you get the picture) it should work.
Last edited on
If you're "brave", there's this patch

Enabling std::thread and friends in MinGW GCC 4.7

I've not tried it, but have been wondering about it...

Last edited on
Use boost if you really need a cross platform solution or change your code.
Thanks for the responses, really appreciate it.

Zephilinox :

tried your suggestion and it looks like mingw does not support std::thread at all.


great link! I followed the steps on the page and std::threads, std::mutex now work. However std::future and std::async are still broken.


1. I want to play around with c++11 concurrency.
2. c++11 concurrency implementations are available on other platforms (mac, linux, etc..). only window seems to be missing it.
3. I know of boost's concurrency features.

thanks for the help.
Topic archived. No new replies allowed.