-
Notifications
You must be signed in to change notification settings - Fork 471
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
Support faster send/recv by not notifying the other side #1039
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! I think it's actually less-syscall, not syscall-free, but this could be more efficient when sending multiple messages continuously. However, we would need a clear caveat in the documentation about the footgun: misuse of this will block the receiver forever. As for the name, I think unnotified is clearer. |
@taiki-e really thanks for the initial feedback!
thanks for understanding of the use case.
agreed. added doc comments what that in mind.
agreed with this too. so, I've refreshed this pr with full coverage of all send methods for the unnotified variant and finished writing doc comments, also ci should be passing. i have a few questions:
lastly, I'm planning to write some unit tests once the direction of this pr is good. last and not least, really thanks for reviewing this pr. I'll try to be very responsive in coming days. my work is blocked on this and other open prs at crossbeam.. so, I'd like them to be shipped asap... :) |
|
(this is a draft)
Introduce a new send variant called (
send_buffered()
), which doesn't notify receivers to avoid syscalls/context switches at the cost of increased latency.sometimes, it's not desirable to incur the potential futex wake syscall cost for each and every message send.
as far as i can tell, there is no way to do like this in the current api:
naming
I haven't decided yet.. considering
.recv()
,{try_,}send_{timeout_,}unnotified()
/{try_,}recv_{timeout_,}unnotified()
might be better.