Tip: Watch out! Use of some versions of STL streams may result in slowdown of your just parallelized application.

Problem : Use of STL streams in your parallelized code seems to cause your application to run 2x to 5x slower when compared to the original serial version.

Environment : This isssue is likely to be specific to streams implementation in certain versions of Microsoft Visual Studio (Ex: Microsoft Visual Studio 2005).

Root Cause : Streams implementation with this issue use an expensive form of synchronization (Critical Section) which causes high contention and effectively slowsdown the parallel version of your application.

Resolution : Use versions of Streams implementation with a fix for this issue - when they become available. As of Oct 05 2009, there are no known versions with the fix. 

Additional Resources: 
 Can STL Streams Run Concurrently: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/b049dbda-c115-410b-b5d8-513f727baf4d

For more complete information about compiler optimizations, see our Optimization Notice.


roman-lygin (Intel)'s picture

Microsoft said this won't get fixed in Dev 10 :-(.
See http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=492561

roman-lygin (Intel)'s picture

Nope, unfortunately Microsoft did not fix it in VS2008SP1 :-(. See further discussion at MSDN forum (link in the post).

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.