Also, this paper is from over ten years ago. If the concept is correct, surely lots of threaded servers would have appeared and their speed would have been beating benchmarks all over the place. Where are these servers?
Also, this paper is from over ten years ago. If the concept is correct, surely lots of threaded servers would have appeared and their speed would have been beating benchmarks all over the place. Where are these servers?
It mentions that using threads is hard. The implication is events are harder.
> suddenly every bit of state in it can be shared by all threads.
Long overlapping chains of callbacks have similar issues. Points where concurrency contexts switch are much larger (between callbacks instead of between machine instructions) but in a large system the danger is real.
> Reasoning about code paths and data accesses becomes amazingly complicated.
Based on working on large systems based on callbacks and based on threads, I've come to the conclusion that both are hard, but callbacks are much harder and messier.
> Where are these servers?
There are everywhere. Java, C++ backend systems. Twitter is using Scala. WhatsApp is using Erlang. PostgreSQL has background processes that help. Apache is the most popular web server.
Now are you saying "where they are?" because we don't read about them on HN every day? Yeah, nobody talks about stuff that works and is established and boring. So perhaps picking technology based on what is read or discussed on HN might not be the best approach ;-)
Twitter and WhatsApp could be good examples, but no-one outside the company can really say that each server there scales well. How many servers does Twitter run? Who knows? So who knows if they are each 'scaling to 100,000 threads and achieving excellent performance', as per the paper's claims?
As for which model is harder or not, I guess that is an arguable matter of opinion. When the paper is claiming that one model is a 'more natural' programming style then it's clearly moving beyond objective reasoning.
There are two things at play here: a) Is the solution easy to design/code. b) Is the solution fast enough.
There is far too much focus on (b) and relatively little attention is given to (a). The claim is that writing code in a direct style in a highly concurrent environment (Go, Erlang, Haskell, SML, ...) is easier and achieves roughly the same performance (within a factor of, say, 2).
My experience is that this is true. I have seen fast evented and threaded systems. But I do feel the threaded systems were easier to write.
In particular, consider the new MIO IO manager included in Haskell GHC 7.8. It's increasing performance of IO-bound lightweight threading by orders of magnitude... all performance provided completely for free to consumers of these abstract threading services who've spent all their time making their algorithms correct, not fast.
State modelling seems pretty powerful, and it always surprises me when people resist it.
Only when you use highly inconvenient model of shared memory. Message passing and shared-nothing combined, as it is done in Erlang or Go, are way easier to reason about, giving at the same time more natural way of structuring code than events handling.
Purely functional language can share state between threads just fine, since any state will be immutable (barring any explicit communication primitives).
I dispute this.
With a functional* approach to writing discrete, modular code with locking as fine-grained and minimal as possible, it's not that hard.
Lot's of threaded servers have appeared. They are, as others have said, absolutely everywhere.
*(not pure functional, just functional as an approach, i.e. writing C code in a side-effect and state-free manner as far as possible)
But, some people have to fail before they learn. Just wish they hadn't failed on such a big project.