3 ms·
> The paper doesn't seem to discuss the important concept that writing threaded code is hard. It mentions that using threads is hard. The implication is events
by rdtsc 13y ago
> The paper doesn't seem to discuss the important concept that writing threaded code is hard.
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 ;-)
- joosters 13y agoI didn't mean that threaded servers don't exist, that's pretty obvious. I meant, as my comment stated, that there aren't threaded servers popping up and demonstrating this fantastic performance/scalability. Hell, Apache moved away from threads. 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.
- jlouis 13y agoErlang routinely runs 100,000 processes in the same memory space and scales very well. The reason it is possible to even handle this is that it is not based on shared memory but on message passing. 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.
- tel 13y agoAnother side effect of focusing on (b) is that it frees up the resources someone else (a runtime implementer) has to focus on (a) independently. This is just another corollary of "build it, build it right, build it fast". 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.
- deleted 13y ago[deleted]
- otterley 13y agoWith respect to WhatsApp, Rick Reed gave a talk in which he discussed how he pushed Erlang to serve 2 million concurrent connections on a single server. http://www.erlang-factory.com/upload/presentations/558/efsf2012-whatsapp-scaling.pdf http://www.erlang-factory.com/upload/presentations/558/efsf2...
- ArkyBeagle 13y agoIt's not clear that events are harder. They are different. I have the biases of someone in the realtime space, where events have been de riguer for a long time, so.... State modelling seems pretty powerful, and it always surprises me when people resist it.