14 ms·
My guess would be that they are wrapping native threading under pthread api. So there is no advantage of using pthread api for win32 apps.
by mmozeiko 11y ago
My 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 11y agoThe advantage is portability. For example, if you're developing a library that needs to be usable on Win32, Linux, and Darwin.
- comex 11y 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 11y 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 11y ago<thr/xthreads.h> is internal and unsupported; please don't use it.
- mmozeiko 11y 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 11y ago[deleted]