Question

Devinder S on Wed, 25 Apr 2012 21:28:51


Are the C++11 threading APIs supported for Metro apps, in particular std::thread but also locks, std::condition_variable, std::atomic?


Sponsored



Replies

Jesse Jiang on Fri, 27 Apr 2012 09:25:39


Hello,

Yes, you can use them in metro. But we would suggest you to use Concurrency Namespace in C++/CX
http://msdn.microsoft.com/en-us/library/dd492819(v=vs.110).aspx

Also, you can follow this blog for PPL C++/CX
http://msdn.microsoft.com/en-us/magazine/hh781020.aspx

Best regards,
Jesse

Steve Horne on Fri, 27 Apr 2012 18:21:23


Related info - http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/383152f2-97a1-4593-a22b-d31e09c611a1

Bottom line 1) Compile CRT referencing code with preprocessor defininition WINAPI_FAMILY=WINAPI_FAMILY_APP at the project level 2) If it compiles, it's safe for Metro style.