0

I'm trying to get started into threading on C++ in eclipse. I want to create Windows applications, and I found that MinGW can't work with threads. I read that others like Cygwin aren't totally compatible.

How do I write threaded programs that works on multiple platforms?

jww
  • 97,681
  • 90
  • 411
  • 885
Nil Llisterri
  • 787
  • 7
  • 19
  • 2
    _"I found that MinGW can't work with threads"_ That's not true. – πάντα ῥεῖ Sep 18 '14 at 17:54
  • Welcome to this site. Unfortunately your question appears off-topic here. For details about asking (on-topic) questions you might want to have look at the [help center](http://stackoverflow.com/help). – moooeeeep Sep 18 '14 at 18:00
  • Check [Does gcc 4.7.1 support threads?](http://stackoverflow.com/questions/12210102/does-gcc-4-7-1-support-threads) 1st please. – πάντα ῥεῖ Sep 18 '14 at 18:01

2 Answers2

2

C++11 fully supports threads, GCC 4.8 fully implements them.

So if you must use threads, use C++'s ones. Avoid messing with pthreads, they are very error-prone.

Also, possibly related question: right here

Community
  • 1
  • 1
TeaOverflow
  • 2,468
  • 3
  • 28
  • 40
1

MinGW support pthreads. But, if you want that your code support many platforms, maybe you must see Boost Threads.

Boost Threads 1.56.0

echo
  • 104
  • 4