1

C++11's threading library is wonderful looking. It's small, simple, standard, and portable. Unfortunately, I'm locked to Visual Studio 2010 which obviously doesn't have that available to it.

My questions are, what multi-threading libraries are available that provide a similar level of functionality, while being portable and reliable? Is it possible (physically and legally) to obtain the corresponding <thread> library to use in VS2010? Are there disadvantages to using a separate library (maybe not as actively maintained since C++11 fills that role, etc)?

Anne Quinn
  • 12,609
  • 8
  • 54
  • 101
  • 4
    I'd say [boost thread](http://www.boost.org/doc/libs/1_55_0/doc/html/thread.html) provides the best approximation. – πάντα ῥεῖ Jul 06 '14 at 20:33
  • 1
    Another option is to install a different C++ compiler on your machine; see the top-rated answer to [this question](http://stackoverflow.com/questions/19425482/windows-c-compiler-with-full-c11-support-should-work-with-qt). Yet another option is to write your work in portable, standard C++11, using gcc or clang on a Linux machine. – NicholasM Jul 06 '14 at 20:42
  • @πάνταῥεῖ - it seems the C++11 threading library was based on boost's to an extent, so that's relieving to know. I'll give that a try, thank you! – Anne Quinn Jul 06 '14 at 20:42
  • @NicholasM: If the first step is to change compiler and operating system, then you may well achieve "standard", but not "portable". – Ben Voigt Jul 06 '14 at 20:47
  • Ah, what I meant was, the source code will be standard and portable. By "portable," I mean, portable to any standards-compliant C++ implementation. Is the source code not portable if a particular user cannot compile it using an old version of a single-platform compiler (VS2010 in this case)? Should developers aiming for portability write for the lowest common denominator, which often arises on Windows? Sorry if this is a little off-topic. – NicholasM Jul 06 '14 at 20:53

1 Answers1

2

First, take a look on wikipedia list of C++ multi-threading libraries. Some very well documented library can by POCO C++. However, you can also see related question Is there any cross-platform threading library in C++?.

Community
  • 1
  • 1
Mihai8
  • 3,113
  • 1
  • 21
  • 31