Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Visual C++ 2010 support the C++11 threads library?

I am using Visual C++ 2010. Does it support the C++11 threads library, such that I could compile the code in this question?

If not, what library can I use that would support this?

like image 269
dato datuashvili Avatar asked Oct 25 '10 07:10

dato datuashvili


People also ask

Does Visual Studio support C ++ 11?

Support for C11 and C17 standards is available in Visual Studio 2019 version 16.8 and later. Support requires an updated Universal C Runtime (UCRT) and Windows SDK version to work properly with the conforming preprocessor ( /Zc:preprocessor ).

What is the name of the C C++ library for threading?

POSIX thread (pthread) libraries. The POSIX thread libraries are a standards based thread API for C/C++. It allows one to spawn a new concurrent process flow.


2 Answers

Visual C++ 2010 does not provide the C++11 thread support or atomics libraries.

If you want to use that code in Visual C++ 2010, you'll need to use a third-party implementation of those libraries. One option is just::thread; it's not free, but I have a copy and am quite pleased with it.

Alternatively, you can use another cross-platform threads library like Boost.Thread or OpenThreads or one of the native Windows threads libraries. Any of these options will probably require changes to the code in order to run.

Note that Visual C++ 11 will support these libraries, and they are included in the Visual C++ 11 Beta.

like image 90
James McNellis Avatar answered Sep 29 '22 01:09

James McNellis


VC++ supports special embedded syntax OpenMP (http://msdn.microsoft.com/en-us/library/tt15eb9t(VS.80).aspx) - note, that g++ is also suports it, so you can get cross platform code.

like image 45
Dewfy Avatar answered Sep 29 '22 01:09

Dewfy