CppCon 2019: Robert Leahy “The Networking TS in Practice: Patterns for Real World Problems”
Video Statistics and Information
Channel: CppCon
Views: 6,408
Rating: undefined out of 5
Keywords: Robert Leahy, CppCon 2019, Computer Science (Field), + C (Programming Language), Bash Films, conference video recording services, conference recording services, nationwide conference recording services, conference videography services, conference video recording, conference filming services, conference services, conference recording, event videographers, capture presentation slides, record presentation slides, event video recording, video services
Id: 3wy1OPqNZZ8
Channel Id: undefined
Length: 58min 35sec (3515 seconds)
Published: Wed Oct 09 2019
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
All of this seems... awefully complex, really. What benefits do this rather extreme complexity bring compared to more conventional socket code?
What is the reason for all this complexity? Why not just expose a basic Socket API??
28:44 - "We've implemented that thing, that people complained was so complicated to implement in the networking TS."
...and it only took around 500 lines of non-trivial code distributed over 7 slides and 4 interacting structs, and that version still had undefined behavior due to data races when used with the default execution context.
I didn't actually use Asio myself so far, but based on this talk it looks like the complaints were justified.
I have one doubt about all this. The Round Robin approach is not horrible, but you can easily end up with an executor/thread handling three long very busy connections with 100% CPU while another io_context, which has in total received the same number of connections, is doing nothing because its connections were short lived.
Sean Parent has convinced me I should be using a work-stealing task system. But since a socket is associated with a io_context at construction time, and can't be changed... I can't move one of those three socket and put it in the free io_context/thread, can I? Doesn't hardcoding the socket with the io_context at construction time make the work stealing impossible?