I've been reading about various new additions to c++ recently that i'm really excited about and i've already been through the new std::unique_ptr and std::shared_ptr objects, which are incredibly useful, and now i'm looking for that native thread library i've heard about and can't seem to find it anywhere. I was reading and went looking for thread.h and msvc++ 2010 express doesn't seem to have it. Did the newest versions of msvc++ not come with this new thread library, or is it just the express version that doesn't come with it, or am i just being silly and have to go looking for a copy of it on the internet? I currently have to do threading via windows functions which i feel are overcomplicated when trying to use mutexes and they're also operating system specific, so i'm really excited to find this standard library implementation :\
Asked
Active
Viewed 9,594 times
3 Answers
4
Not all C++11 changes are in the Visual C++ 2010 compiler. You will need to use boost::thread or just::thread as alternatives, or use the Visual Studio 11 Beta:

James McNellis
- 348,265
- 75
- 913
- 977

Joe
- 41,484
- 20
- 104
- 125
-
1ah alrighty then, at least I've got smart pointers for now. I was gonna look at boost::thread next anyway, just wanted to make sure there wasn't an available standard library equivalent. So it's safe to assume that the next release of visual studio will most likely have std::thread available? – FatalCatharsis Feb 12 '12 at 18:12
0
None of the editions of VS2010 come with std::thread
. Remember that VS2010 pre-dated the C++11 standard.
You could try boost::thread
as an alternative. The design of std::thread
is an evolution from boost::thread
and so it should not be too traumatic to switch to std::thread
when it becomes more widely implemented.

David Heffernan
- 601,492
- 42
- 1,072
- 1,490
-
Sadly, `std::thread` has no interruption points. Reason enough for me to stick with `boost::thread`, as long as they don't remove it – pezcode Feb 13 '12 at 23:39
0
VS2012 Beta should be released this month, will be better than the developer preview.

NFRCR
- 5,304
- 6
- 32
- 37