Linked Questions

1 vote
0 answers
153 views

Nodejs is known to be best for simplification by "single thread". As I know, this single thread handles requests through a event loop. I want to ask: Is Nodejs really only have one thread only? For ...
user1657499's user avatar
0 votes
0 answers
89 views

I am learning the basics of Node.js. One thing that constantly confuses me is the event loop. From what I have learned, Node.js handles asynchronous functions using threads in libuv. How does chrome ...
Nithin Mohan's user avatar
-1 votes
1 answer
67 views

https://medium.com/the-node-js-collection/what-you-should-know-to-really-understand-the-node-js-event-loop-and-its-metrics-c4907b19da4c according to the above blog post,"There is only one thread that ...
Satoshi Gekkouga's user avatar
25 votes
2 answers
8k views

I have learned that node.js use libeio internally to perform async file I/O, with thread pool, on *nix platform, am I right? What about async network I/O? Is it done by libev? Is there also a ...
Aaron Wang's user avatar
  • 1,101
19 votes
3 answers
12k views

In JavaScript, the event loop is used in the engine. Here is one diagram to illustrate it from this article. (source: mybalsamiq.com) For Node.js, the event loop also implemented here. Quoting from ...
zangw's user avatar
  • 49.1k
12 votes
3 answers
3k views

A simple node program with a single line of code quits immediately after running all the code: console.log('hello'); However, an http server program listening on a port does not quit after executing ...
user avatar
8 votes
3 answers
5k views

How do all the languages implements asynchronous callbacks? For example in C++, one need to have a "monitor thread" to start a std::async. If it is started in main thread, it has to wait for the ...
SwiftMango's user avatar
  • 15.4k
7 votes
3 answers
1k views

Is node's javascript environment single threaded, or does everything happen at the same time? Or (more likely) do neither of those statements explain what's going on with node. I'm new to node and ...
Alana Storm's user avatar
3 votes
2 answers
2k views

I don't understand the difference in java multithread system and Nodejs mutltithread system in terms of peformance and resource sharing. As NodeJS use event loop single thread for your program but ...
Shad's user avatar
  • 1,039
4 votes
4 answers
1k views

Consider the following piece of code: var some_expensive_task = function(i) { setTimeout(function() { var a = 1; while (a < 100000000) { Math.sqrt(a); ...
brian's user avatar
  • 2,785
4 votes
3 answers
555 views

I'm new to Node.js. I've been working my way through "Node.js the Right Way" by Jim R. Wilson and I'm running into a contradiction in the book (and in Node.js itself?) that I haven't been able to ...
Kent Rancourt's user avatar
1 vote
2 answers
1k views

I read Nodejs Event Loop and "Event Loop Explained" and Don't Block the Event Loop I don't think there is a for/while forever loop in nodejs code (js or c++), e.g. as here explains libev ...
Qiulang's user avatar
  • 12.8k
4 votes
1 answer
607 views

I have read a lot of guides and resources about event loop but I still do not know what is the event loop itself ? I know it is implemented by libuv library but what is that thing which is ...
MrCoder's user avatar
  • 173
2 votes
2 answers
725 views

If I have an SMTP server (like haraka) or a web server (like Express) that uses Node.js and I have to use a sync function that could not convert to be Async what would happen? If I have to make an ...
Ricardo Polo Jaramillo's user avatar
9 votes
2 answers
447 views

My ex boss had a weird bug where when he used setInterval with a long delay interval: setInterval(func, 3000000 /*50 minutes*/); Node.js crashed. func can be even a simple function that simply ...
gdoron's user avatar
  • 151k

15 30 50 per page