Re:Concurrency in Ruby almost as good as Node.js
by chaostheory on Wednesday August 17, 2011 @05:57PM
(#2897122)
Yes the nodejs concurrency model takes some time getting used to, but working with threads is much harder imo. Raw speed benchmarks don't do enough to give a full picture.
[ Parent
| on HN ]
Re:Concurrency in Ruby almost as good as Node.js
by mhd on Wednesday August 17, 2011 @06:17PM
(#2897192)
This is comparing nodejs with Ruby's EventMachine, so where do threads enter the picture? It's been a while since I looked at EM, but if I remember correctly, it's pretty much in the same area as Python's Twisted or node.js, as opposed to something like plain ol' Java threads or Erlang.
Re:Concurrency in Ruby almost as good as Node.js
by stock_toaster on Wednesday August 17, 2011 @11:52PM
(#2897893)
I don't actually even see eventmachine in there, aside from a remark about having tried it in the opening introduction. Seems it is just comparing node with sinatra+mongomapper running under thin or unicorn.
Based on the title I assumed it was something like goliath or sinatra/async with rainbows!/thin. Looking at the git repo linked in the article though, I don't believe that is the case.
Re:Concurrency in Ruby almost as good as Node.js
by simpsond on Wednesday August 17, 2011 @06:15PM
(#2897186)
EventMachine uses an event loop like node, so threads are somewhat irrelevant here. Unless "workers" are threads and not actual processes, but I am pretty sure they are processes.
Re:Concurrency in Ruby almost as good as Node.js
by jshen on Wednesday August 17, 2011 @06:03PM
(#2897144)
Working with threads in the context of a web request is not hard.
Re:Concurrency in Ruby almost as good as Node.js
by getsat on Wednesday August 17, 2011 @07:55PM
(#2897429)
Threads are inferior to events for concurrency, but they're better for throughput.
number_of_threads * thread_stack_size = sadface.jpg (when trying to use threads to handle lots of connections)