Live data from Hacker News

Threaded vs Evented Servers

mmcgrana.github.com

31–32 of 32 posts

Re: Threaded vs Evented Servers

#31

I would find it much easier to follow the article if the author used traditional mathematical notation instead of Clojure. Which do you prefer? (* t (/ 1000 w)) or (perhaps typeset properly) t * 1000 / w

I much prefer the clojure to the mathematical notation and secretly wish academics would use code instead of traditional notation (when possible).

Re: Threaded vs Evented Servers

#32
post #30
post #16

Earlier quoted context omitted.

No, while this is a wonderful analogy, I don't think this is actually a problem. It's more like assuming horses weigh 1000 kg --- wrong for all but the biggest draft horses, but a nice round number to work with. For the level of analysis in the article, there's really no difference between a 4 core machine and a processor with a 4x clock speed. His point is that the threaded model makes the most sense when each reque…

False. An evented server (at least, until they get a lot fancier and make you program with locks and such) only gets to use one of the cores, while a threaded server gets all four. Using a single core just means that the threaded server doesn't get any advantage from being threaded, while the evented server gets everything it can use. This "model" is worthless for comparison.

It is pretty easy to build a round robin load scheduler that queries for x amount of cores on a system, spawns a thread for x cores and then schedules request to the least burdened core. This reduces the amount of threads the server uses while still taking advantage of evented co-routine based processes. (this stuff is not new, Node just kicked off interest again due to its growing popularity). If evented servers catch on, I think you will eventually see this as a hybrid solution. But yes you will certainly need threads or different processes, to take advantage of multi-core systems, it just a question of whether or not you need a thread per request. There are also a lot of security implication that are getting glossed over in the talks about evented servers.
Post reply on HN