Coordination between these threads are actually very simple. There is no threads. Node.js is a single-threaded application, unless you're using cluster module, in which case it's still pretty much single-threaded as well.
There is such thing called "thread pool", and it is maintained by libuv for IO only. However, it has nothing to do with javascript, and I don't know how it works because it never made any difference. My point is: "async" and "promises" work in just one single thread. Thread pool is another thing entirely, it's very low level, so it has nothing to do with control flow. Does it answer your question? On Monday, November 25, 2013 8:40:30 AM UTC+4, Swetha wrote: > > There are many possible techniques for handling control flow in Nodejs. > For example, "async" module or chaining "promises" can be used to execute > dependent/independent asynchronous calls in serial or parallel. All > asynchronous calls are handled sequentially by the node's event loop, which > assigns their execution to a thread from internal thread pool maintained by > nodejs. > Can anyone explain how does the coordination between these threads happen > internally at system level? > Do they use shared queues for message passing or use semaphores to trigger > dependent asynchronous calls? > > I would like to know the technical aspects of control flow in Nodejs. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
