just::thread C++11 Thread Library V1.8.0 vs Microsoft Visual Studio 2012
Thursday, 06 September 2012
I am pleased to announce that version 1.8.0
  of just::thread,
  our C++11 Thread Library
  has just been released.
This release adds official support for Microsoft Visual Studio 2012, as well as providing some minor bug fixes and improvements across the board.
Some people have asked how Just::Thread compares to the thread-library support in Microsoft Visual Studio 2012, given that VS2012 now provides the new C++11 concurrency headers, so I ran some of the Just::Thread tests against the VS2012 library. It turns out that there are quite a few places where Just::Thread has better conformance than VS2012, so if you're making heavy use of the C++11 thread library then upgrading to Just::Thread is an essential investment.
VS2012 thread library conformance issues
Here is a list of some of the areas where Just::Thread provides better conformance than VS2012. Some of these can be worked around; others are important for correctly-functioning code. This is just a sample, not a comprehensive list.
- With the VS2012 library, you cannot use move-only types with std::promise, andstd::asyncdoesn't work with functions that return move-only types.
- With the VS2012 library, std::threaddoesn't work with move-only argument types.
- With the VS2012 library, the wait_forandwait_untilfunctions return incorrect values when used with astd::futurethat comes from astd::promise.
- With the VS2012 library, when std::asyncis used with a launch policy ofstd::launch::async, the destructor of the returnedstd::futureinstance does not wait for the thread to complete.
- With the VS2012 library, std::unique_lockdoes not check whether or not it owns the lock before calling operations on the underlying mutex, triggering undefined behaviour rather than throwing an exception in many cases.
- With the VS2012 library, the std::atomic<>class template cannot be used on types without a default constructor.
- With the VS2012 library, std::launchand other strongly-typed enums such asstd::future_statusare emulated with a namespace-scoped enum rather than a strongly-typed enum.
In all these cases (and more), Just::Thread conforms with the standard.
Just::Thread optimizations
Just::Thread also offers various optimizations over the VS2012 thread library such as the following.
- The return value from a task run with std::asyncis copied/moved fewer times, and moved where possible.
- A function object passed to std::threadis copied or moved fewer times.
- The task passed to std::asyncis destroyed as soon as the task is completed, even if there are outstanding futures that reference the result.
Again, this is not a comprehensive list. Just::Thread has been carefully optimized to ensure common use cases have the best performance possible whilst remaining conformant to the C++11 standard.
Get your copy of Just::Thread
Purchase your copy and get started with the C++11 thread library now.
As usual, existing customers are entitled to a free upgrade to V1.8.0 from all earlier versions.
Posted by Anthony Williams
[/  news /] permanent link
  Tags:  multithreading,  concurrency,  C++0x,  C++11 
   Stumble It!  | Submit to Reddit
 | Submit to Reddit  | Submit to DZone
 | Submit to DZone 
If you liked this post, why not subscribe to the RSS feed  or Follow me on Twitter? You can also subscribe to this blog by email using the form on the left.
 or Follow me on Twitter? You can also subscribe to this blog by email using the form on the left.
Design and Content Copyright © 2005-2025 Just Software Solutions Ltd. All rights reserved. | Privacy Policy
3 Comments
Some essential C++11 functions are decreased, like Variadic layouts, Non-static information participant initializers, Unicode sequence literals, and so on. Well, without those functions, C++ will never be excellent enough to defeat C#. You created it. Ms created it.
after reading from your post reader can easily differentiate.