-
Notifications
You must be signed in to change notification settings - Fork 20
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
Range Interface #5
Comments
Could I ask you in what kind of application you are currently using cpp-channel? |
@ahorn Currently, I am not using it in any real application. I am just getting to know Go and thought that something channel like would be interesting in C++ and that's how I found cpp-channel. |
Cool. This doesn't sound too unfamiliar :) I started this repository because I wanted to find out how far one gets by using the new C++11 concurrency-related features in implementing Go-style channels. In doing so, I've come to the conclusion that C++11 condition variables and locks are probably not the way to go because the operations on channels lead to many context switches, and the overhead for this is quite high. A different (and faster implementation) may be possible by using coroutines. It my understanding that there is some discussion in the standard committee for adding some coroutine-like features to the language. In the meantime, however, it would be worthwhile to ask Oliver Kowalke if it would be okay to take his context library and use it directly without the other parts of boost. I see several benefits of using coroutines: (1) easier reasoning about scheduling, (2) more efficient handling of OS context switches (3) full featured cpp::select statements. |
Yeah, that makes sense. If I got it right then the standard coroutines are quite on track. Using |
It depends; I think it depends how boost::coroutine work. Would you feel comfortable implementing a prototype that uses boost::coroutine so we could take a look at the design space? |
I will have a look at |
Cheers. |
So, I had a look at During my research about how Go implements the channels/select I found this link. They are basically also using a lock/lock-free ringbuffer for the communication channel. In case, you didn't know them yet, I would check out the links as I think that they are quite interesting. |
This is helpful. Thank you. Are you planning to implement anything? |
Not for now. |
Hi,
I am wondering whether you have put any thought or what you think about providing a range interface via fake-iterators/
begin/end
?So that we could use the channel as one can use it in a Go loop:
I quickly wrote something together using
boost::iterator_facade
and while it seems to work it's pretty hacky.Cheers,
Stephan
The text was updated successfully, but these errors were encountered: