Reputation: 227
many of them saying that node js is single threaded, but it process callback functions parallely during other process. as per my assumption single thread can handle only one instruction at a time. so how it process asynchroniously many instructions at a time?
Upvotes: 1
Views: 2131
Reputation: 569
Yes, Nodejs is single threaded but internally uses libuv library https://github.com/libuv/libuv
Which is written on c++ and uses thread pooling concept in case if I/O or File system operation and having internal workers for same.
you may go through link to know about deep
https://www.journaldev.com/7462/node-js-architecture-single-threaded-event-loop
Upvotes: 4