-
Notifications
You must be signed in to change notification settings - Fork 123
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
Efficient single-threaded client implementation? #690
Comments
This is one thing that seems awkward to do with Rust currently. There isn't a good way to define types that are generic over whether they use
You're not wrong that it adds overhead, but "a bunch" is likely an overestimate. I believe Though if you come up with a good way to benchmark this, it probably isn't too hard to find-and-replace the uses of |
I absolutely agree with this: in the grand scheme of things it's highly likely to be irrelevant. However, that's similar to leaving the water running while brushing your teeth—does it really matter? Nah, but it still feels wrong. Anyway, I think this a "would be nice someday" issue. Hopefully I'll have time to look into it in a few months. |
Perhaps more important than the use of That forces the caller to either also use thread safe types, or use some Not sure there's any easy way to improve that though. Maybe you'd need some kind of split between the type of |
I'm looking to build a clipboard manager with a single threaded event loop that uses io_uring. AFAIK I should be able to add the wayland socket as one of the tasks my event loop is waiting for. What's the best way to integrate with this crate without going through a bunch of Arcs and Mutexes? I'm aware of
connection_fd
which will at least let me be single-threaded with io_uring, but it just seems like a waste to have a bunch of overhead for multi-threading if I'm not going to use it.The text was updated successfully, but these errors were encountered: