开发者

Which process space do node.js' async calls live in?

开发者 https://www.devze.com 2023-03-20 23:36 出处:网络
When an http request hits node.js and node subsequently dispatches that request asynchronously, in whose pro开发者_如何转开发cess space does that work live (the work being done in the asynch call)?Sam

When an http request hits node.js and node subsequently dispatches that request asynchronously, in whose pro开发者_如何转开发cess space does that work live (the work being done in the asynch call)?


Same process that accepted request (and same thread). All javascript code and event loop is executed in one tread. Some function calls are dispatched internally via thread pool but "userspace" (e.i your javascript code) always run in single thread

0

精彩评论

暂无评论...
验证码 换一张
取 消