Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use C++11 threading with Visual Studio

Before I start I want to explain that I am a novice and that it's highly possible that I've missed something simple or that there's something simple that I just don't know about.

Using visual studio I wanted to get a bit of threading practice in but I can't get it to include at the top of my code. I know that is new to C++11 but I'm not sure if that's enabled for Visual Studio 2010 or if it isn't I'm not sure how I would go about doing that.

Here is a screenshot of my code:

My Code

like image 756
Joseph Little Avatar asked Dec 20 '22 08:12

Joseph Little


1 Answers

You cannot: C++11's Thread support library is not supported by the implementation of the C++ Standard Library shipped with VS2010. You should upgrade to VS2012 if you want to use it.

Alternatively, you could use Boost.Thread, which served as an inspiration for C++11's Standard Thread support library.

As a further option, you could consider purchasing the Just.Thread library, which provides a complete implementation and is available for VS2010 as well.

like image 82
Andy Prowl Avatar answered Dec 24 '22 00:12

Andy Prowl