3 ms·
For iOS and Android apps you must have implemented some POSIX APIs that Windows hasn't supported historically, such as pthreads. Will it now be possible to writ
by modeless 12y ago
For iOS and Android apps you must have implemented some POSIX APIs that Windows hasn't supported historically, such as pthreads. Will it now be possible to write a Win32 app using pthreads?
- mmozeiko 12y agoMy guess would be that they are wrapping native threading under pthread api. So there is no advantage of using pthread api for win32 apps.
- modeless 12y agoThe advantage is portability. For example, if you're developing a library that needs to be usable on Win32, Linux, and Darwin.
- comex 12y agoIn C++ you can use std::thread for this purpose. In C, in theory C11 thrd_* would be better to implement than pthreads, since it's been standardized... too bad none of the major platforms support it in their default libcs, so Windows implementing it wouldn't actually improve portability. If Windows implements pthreads, maybe there'll be a C1y that removes thrd_* from the standard and just standardizes pthreads. That'd be funny.
- mmozeiko 12y agoFunny, but VS2013 has <thr/xthreads.h> header that pretty much is C11 <threads.h> implementation. Just with a bit different naming of symbols. And not sure if it is 100% compatible.
- StephanTLavavej 12y ago<thr/xthreads.h> is internal and unsupported; please don't use it.
- mmozeiko 12y agoI understand your point. But that won't solve portability issue, because I bet their pthread API will be available on VS2015 (if at all). No portability for VS2013 or less. For my code I simply just wrap the native threading api - posix or win32. It's not a big deal.
- deleted 12y ago[deleted]
- StephanTLavavej 12y agoI don't know anything about iOS/Android targeting, but I've asked people who do to comment. I do not believe that pthreads will be available for Win32 but I could be wrong.
- AlexeyBrin 12y agoIf you are using C++ or Objective-C++ you can use C++11 threads (which are portable on all current operating systems) directly, no need to use pthreads.
- angersock 12y agoSome of us aren't using C++. Hence, the desire to see MSVC support the C11 and C99 standards.
- AlexeyBrin 12y agoI don't use C99/C11 regularly, but I would love to see a VS that fully implements at least the C99 standards. My comment was specifically about using pthreads which are standard only on UNIX like systems.