Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1045451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:59:11+00:00 2026-05-16T15:59:11+00:00

I just watched the following video: Introduction to Node.js and still don’t understand how

  • 0

I just watched the following video: Introduction to Node.js and still don’t understand how you get the speed benefits.

Mainly, at one point Ryan Dahl (Node.js’ creator) says that Node.js is event-loop based instead of thread-based. Threads are expensive and should only be left to the experts of concurrent programming to be utilized.

Later, he then shows the architecture stack of Node.js which has an underlying C implementation which has its own Thread pool internally. So obviously Node.js developers would never kick off their own threads or use the thread pool directly…they use async call-backs. That much I understand.

What I don’t understand is the point that Node.js still is using threads…it’s just hiding the implementation so how is this faster if 50 people request 50 files (not currently in memory) well then aren’t 50 threads required?

The only difference being that since it’s managed internally the Node.js developer doesn’t have to code the threaded details but underneath it’s still using the threads to process the IO (blocking) file requests.

So aren’t you really just taking one problem (threading) and hiding it while that problem still exists: mainly multiple threads, context switching, dead-locks…etc?

There must be some detail I still do not understand here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:59:12+00:00Added an answer on May 16, 2026 at 3:59 pm

    There are actually a few different things being conflated here. But it starts with the meme that threads are just really hard. So if they’re hard, you are more likely, when using threads to 1) break due to bugs and 2) not use them as efficiently as possible. (2) is the one you’re asking about.

    Think about one of the examples he gives, where a request comes in and you run some query, and then do something with the results of that. If you write it in a standard procedural way, the code might look like this:

    result = query( "select smurfs from some_mushroom" );
    // twiddle fingers
    go_do_something_with_result( result );
    

    If the request coming in caused you to create a new thread that ran the above code, you’ll have a thread sitting there, doing nothing at all while while query() is running. (Apache, according to Ryan, is using a single thread to satisfy the original request whereas nginx is outperforming it in the cases he’s talking about because it’s not.)

    Now, if you were really clever, you would express the code above in a way where the environment could go off and do something else while you’re running the query:

    query( statement: "select smurfs from some_mushroom", callback: go_do_something_with_result() );
    

    This is basically what node.js is doing. You’re basically decorating — in a way that is convenient because of the language and environment, hence the points about closures — your code in such a way that the environment can be clever about what runs, and when. In that way, node.js isn’t new in the sense that it invented asynchronous I/O (not that anyone claimed anything like this), but it’s new in that the way it’s expressed is a little different.

    Note: when I say that the environment can be clever about what runs and when, specifically what I mean is that the thread it used to start some I/O can now be used to handle some other request, or some computation that can be done in parallel, or start some other parallel I/O. (I’m not certain node is sophisticated enough to start more work for the same request, but you get the idea.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just watched a video of Douglas Crockford's presentation about his 2009 book JavaScript:
I just watched the Windows Azure intro video and it left me feeling like
I just watched Google Wave Keynote video on Google I/O and I must say
I just watched a video regarding the Report Designer. It said to go to
I just watched a Google tech talk video covering Polyworld (found here ) and
I've just watched this video showing off an app: https://www.youtube.com/watch?v=2qM3Zps_0pE&feature=player_embedded At 3:34. How in
I just watched a video about unit testing WebOS applications and they used the
I just watched this funny YouTube Video about unit testing (it's Hitler with fake
I just watched a video on protocols in Clojure and it explained how 'multimethods'
I just watched a jQuery mobile introductory video featuring the flip transition. I find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.