Re:Fast, Safe, and Complete(ish) Web Service in Rust
by fafhrd91 on Tuesday March 27, 2018 @05:53PM
(#16693089)
i'd say in most projects i worked, threads would be enough. but it is so boring :)
new shiny async code is much more entertaining!
on other hand we should talk about C100k or C1m problems.
Re:Fast, Safe, and Complete(ish) Web Service in Rust
by nordsieck on Tuesday March 27, 2018 @11:29PM
(#16695017)
Someone actually coined the C10M problem a while back [0]. It looks like it hasn't been updated in quite a while, though.
Re:Fast, Safe, and Complete(ish) Web Service in Rust
by kitd on Wednesday March 28, 2018 @08:25AM
(#16697138)
The problem is that, in practice, many of those thread contexts are holding open resources like DB connections or file handles, and the costs related to those mount pretty quickly.
This is why actor models are good IMO. They are based on the actual resource model, rather than the developer's mental model. That is, until the developer learns to change his/her mental model.
Indeed. I remember being shocked when I first read "Thousands of Threads and Blocking I/O" [0] by Paul Tyma.
After reading the C10k problem [1], I just believed that a big pile of threads would never work and never updated my beliefs. While such an approach is still quite memory limited compared to asynchronous approaches, it scales quite far and can have a very high work rate.
[0] https://www.slideshare.net/e456/tyma-paulmultithreaded1
[1] http://www.kegel.com/c10k.html