-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use std::condition_variable_any, move configuration to build files #3405
Conversation
…ck<std::mutex>, leading to two mutexes used in condition_variable_t Solution: use std::condition_variable_any instead
I can have a look at providing the autoconf one later tonight, but what is the check looking for exactly? |
What I implemented for CMake now are the following defaults:
The user can provide a custom value for ZMQ_USE_CV_IMPL, which overrides the above defaults. autotools must probably also have a case for vxworks |
b05b436
to
f25f5a1
Compare
@sigiesec here's a working diff:
|
that said, I'm not a huge fan of having such a granular and low-level option - if anything, it should force C98 compat for everything or for nothing - which already exists as |
First of all, thanks a lot for the patch!
Hm, why? I think the options in general deserve some better naming/structuring, but when this were done, it doesn't hurt to make all things configurable, where the choice is not absolutely clear (because only 1 of n can work at all, or is clearly better on all supporting platforms).
I don't quite understand this in particular. The choice between implementations does not need to have something to do with compatibility. It depends on the platform which implementation is better (esp. performance-wise). And at least on MinGW, you actually have the choice between three implementations, namely pthreads, win32api and stl11. |
Solution: calculate from CMAKE_SYSTEM_VERSION Problem: CMAKE_SYSTEM_VERSION might be newer than Windows SDK Version Solution: limit _WIN32_WINNT value to Visual Studio default Windows SDK version
…g and not configurable Solution: move configuration to build definition
…newer due to duplicate definition of htonll Solution: use custom implementation only on older Windows versions
Solution: change variable type to size_t
Solution: change into regular control flow condition
bf3ec80
to
7fbd977
Compare
To put it in another way: is there any reason someone would want to pick the C11 implementation of foo, but the C98 implementation of bar? As far as I can see, either one wants max compatibility or the modern implementations, which are usually better |
I think the "usually" restriction is the point. I am not sure about std::condition_variable, but std::mutex on VS2015, e.g., is supported but significantly slower than using CRITICAL_SECTION |
ok, fair enough - the options should be cross-checked with the force-cxx98 flag as well, to avoid inconsistent configurations |
Should anything be added in either the autotools or cmake code before merging? |
No, looks good to me, thanks |
Fixes #3404