Hacker News new | past | comments | ask | show | jobs | submit login

You can do async/event based programming using coroutines instead of threads, thus achieving non blocking behaviour. Nginx does that for instance.



Sure, but then you are not having all cores contributing to the same solution. Each nginx request is then distinct from every other request. And really then it's easier to scale with separate machines like google does in it's completely synchronous environment.


So you start a number of workers and distribute the load among them. At least that's one way to solve the problem in Perl/Python/Ruby. You can contribute to the same solution by passing data to a master process, or using shared memory.

In Erlang and Scala you can solve it even more ellegantly using actors and chanels. Go has goroutines and channels. All of these can span multiple cores.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: