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
Fixing the queue LCO and add example demonstrating its use #1627
Conversation
… removes the stubs/queue.hpp
Works for me (albeit it is slower than I hoped it would be) |
@TheConstructor Can you show us your code and your numbers, please? Let's see what we can do to improve things. |
So, my application currently looks like this: https://gist.github.com/TheConstructor/5a29ecba757b308b690d On my computer (Mac OS X 10.10.3, 4 HT-Cores at 2.5GHz, 16MB RAM) EXA_2015_INTERACT_REDUCE_MODE=1 takes 6 Seconds to complete and EXA_2015_INTERACT_REDUCE_MODE=3 takes 30s+ This is terminal-ouput for EXA_2015_INTERACT_REDUCE_MODE=3:
And then there is seemingly an error in the queue-implementation I missed at first:
|
- Fly-by changes to detail::condition_variable: - fix return value for notify_one - Remove entries from queue before checking for errors
@TheConstructor The queue should be fine now, I fixed a possible race condition. For your code, I'm surprised it compiled at all (it did not for me). You're still serializing lambda functions, which does not work. Just because you wrap the lambda into a boost::function does not mean that it will be serializable. Even if you wrapped it in hpx::util::function it wouldn't work. Also, why are your function objects derived from boost::function? This is not necessary. |
I don't remember right now why I derive the classes from boost::function. I vaguely remember that there was a problem otherwise, which might have also been solved by adding const to operator(). I am still a bit confused that lambdas are so much less than a function object. Last thing I remembered was that you need explicit types on them and they should behave just fine. An lastly: what kind of compiler errors did my code generate? I used LLVM 6.1.0/clang-602.0.53 and it compiled fine. Care to share what you needed to change? Will try with the new commit soon. |
Ok, seems to work now:
|
Lambdas have no (observable) type, thus they can't be re-constructed (de-serialized).
The compilation error happened only after I changed your use of |
Fixing the queue LCO and add example demonstrating its use
Also this removes the stubs/queue.hpp