[PATCH] D20328: [libcxx] Externally threaded libc++ variant
Asiri Rathnayake via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 7 09:26:04 PDT 2016
rmaprath added a subscriber: STL_MSFT.
rmaprath added a comment.
In http://reviews.llvm.org/D20328#451178, @mclow.lists wrote:
> Also, I don't see how this can be retargeted "at runtime"; are you implying that someone can choose at program launch time what threading system to use?
Yup, users can link their objects with an implementation of the dynamic threading API and it should all be fine.
> How could that work given (say) a constexpr constructor for a mutex type?
> [ I read the previous discussion, but still don't see how to make it work]
Yeah, that is a real pain point. I have provided a sample implementation of the API in `test/support/external_threads.cpp` (last file in this patch) where I've adopted a initialize-on-first-use policy to workaround this particular problem. I've put a bunch of comments there to explain the details.
The `constexpr` mutex constructor is apparently also a pain point on windows [1], I'm sure @STL_MSFT knows more about it.
Thanks!
/ Asiri
[1] https://blogs.msdn.microsoft.com/vcblog/2015/06/02/constexpr-complete-for-vs-2015-rtm-c11-compiler-c17-stl/
http://reviews.llvm.org/D20328
More information about the cfe-commits
mailing list