Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Node.js Basics (2014) Introduction to Node.js Why use Node.js?

Arent there other technologies that are Non Blocking ?

Does multiple threads in a web server (apache) or async http technologies like async http servlet (java) achieve the same goal?

6 Answers

Sang Han
Sang Han
1,257 Points

There are a lot of programming languages that offer non-blocking or asynchronous programming.

  • NodeJS allows both synchronous and asynchronous programming, but you can never mix the two. Asynchronous functions return callbacks while synchronous ones return values.
  • Google Go was designed with asynchronously in mind, so all IO operations become non-blocking by design of the language.
  • With the release of Python 3.4 this year asynchronous io became a module in the standard library. But even before then, many 3rd party libraries and web frameworks like (tornado, gevent, twisted) all had implemented some form of asynchronous programming.
  • I'm not too familiar with Ruby on Rails (someone can correct me), but I think a lot of concurrency is done multi-threaded unlike the other ones I mentioned above.
Kostas Oreopoulos
Kostas Oreopoulos
15,184 Points

Actually, from what i have been reading (trying to understand how nodejs works), when concurrency is the subject, nodejs is not in the top of the list.

I guess one of the best in concurrency is Go.

A nice slideshow with what is concurrency and what parallelism can be found here

Camila N
Camila N
10,677 Points

Don't forget Erlang! In my list of programming languages to learn.

Rails work with gems, so exists gems to make rails use multiple threads. Also .NET have a asynchronous way to work.

Regina Soifer
Regina Soifer
7,386 Points

This is a must. Besides the valuable concepts there is also the historical value :)

Ryan Dahl: Original Node.js presentation https://www.youtube.com/watch?v=ztspvPYybIY

To make applications faster, I believe we should use Rubinius.

http://rubinius.com/

https://www.youtube.com/watch?v=C5fa1LZYodQ