如何理解Node的单线程
Youky ... 2023-6-20 Less than 1 minute
# 如何理解Node的单线程
单线程指的是Node中代码的执行是单线程的,而Node的宿主环境并不是单线程。
实际上一个.js
文件在执行时,操作系统运行了若干个线程:
- 执行JS代码的线程
- 执行异步操作的线程池
- 处理调试信息的线程
- 调度任务优先级的线程
- 执行代码调优的线程
单线程指的是Node中代码的执行是单线程的,而Node的宿主环境并不是单线程。
实际上一个.js
文件在执行时,操作系统运行了若干个线程:
This app can be installed on your PC or mobile device. This will allow this web app to look and behave like any other installed app. You will find it in your app lists and be able to pin it to your home screen, start menus or task bars. This installed web app will also be able to safely interact with other apps and your operating system.