Wednesday, 17 May 2017

Arent most of modern webserver single threaded in nodejs's point of view?

First of all, thanks for reading my question:)

Let me be clear. I'm not asking what it was like in the past.

My first non-trivial programming is quite recent so I really don't have experienced that, however I heard of 'thread pool' or 'connection pool' things many times.

And I met nodejs. It said It's using async, single threaded event(right? anyway I mean outermost request handler) loop and I was like "Good, You mean I don't need to set the number of connection pool, right?"

But after few month I got into scala-play framework and It seemed like It also plays in similar way. Of course It's not saying it's using single threaded event loop, but it's using akka or any other asynchronous way to deal with each request and that means there's no point to use multi-threading on event loop in cpu resource's perspective.

And I looked around. Maybe time flied since nodejs wrote it's introduction, or I'm misunderstanding some point, but anyway now it seems like most framework's using single threaded event loop - by event loop I mean a thread pick a request from queue and throw it to another thread/process.

Am I missing something? or looking in right way? Considering nodejs's using single thread only for it's event loop not for whole server, I got quite confused with nodejs's difference with other languages



via Haedaal

No comments:

Post a Comment