当前位置:网站首页>EventLoop learning
EventLoop learning
2022-06-27 13:37:00 【If you can't, just drink beer.】
Summarize your recent work on eventloop Learning from .
Things have to come from js The characteristics of single thread begin to talk about .
Threads and processes
Thread process details
Thread process Ruan Yifeng image details
Yes js This single threaded thing , It's probably just that 
But this thing is so bad , The red part is always waiting . So on the one hand, in order to solve the efficiency problem caused by this waiting mechanism ,js We used eventloop The mechanism of .
Event loop
Personal understanding Event loop It is a set of operating mechanism , It is similar to proposing a solution to the single thread blocking problem . For example, in the browser js:
1、js Run the program in the execution stack , Put the macro task and micro task in the process into the macro task queue and micro task queue respectively .
2、 After the execution stack is empty , Take the micro task from the micro task queue and put it into execution
3、 After the micro task runs empty , Take macro task from macro task queue and put it into execution , repeat 2、3.

Figure from https://segmentfault.com/a/1190000016278115
边栏推荐
- IJCAI 2022 | greatly improve the effect of zero sample learning method with one line of code. Nanjing Institute of Technology & Oxford proposed the plug and play classifier module
- Cloud native (30) | kubernetes' app store Helm
- 打印输出数(递归方法解决)
- AXI總線
- Yyds dry goods inventory solution sword finger offer: cut rope (advanced version)
- Cesium实现卫星在轨绕行
- Istio微服务治理网格流量管理核心资源控制器详解
- After 2 years of outsourcing, I finally landed! Record my ByteDance 3 rounds of interviews, hope to help you!
- Summary of basic usage of command line editor sed
- To understand again is the person in the song
猜你喜欢

A pang's operation record
Kotlin函数使用示例教程

Axi bus

Tiktok practice ~ public / private short video interchange

一次性彻底解决 Web 工程中文乱码问题

深入理解位运算

Pre training weekly issue 51: reconstruction pre training, zero sample automatic fine tuning, one click call opt

hue新建账号报错解决方案

Half find (half find)

Firewall foundation Huawei H3C firewall web page login
随机推荐
同花顺能开户炒股吗?安全吗?
Intranet learning notes (8)
Ali an interview question: use two threads to output letters and numbers alternately
Summary of redis master-slave replication principle
OpenHGNN发布0.3版本
高效率取幂运算
How to modify a node_ Files in modules
《预训练周刊》第51期:重构预训练、零样本自动微调、一键调用OPT
Yyds dry goods inventory solution sword finger offer: cut rope (advanced version)
[acwing] explanation of the 57th weekly competition
To understand again is the person in the song
【Acwing】第57场周赛 题解
Postman如何设置成中文?(汉化)
Today's sleep quality record 78 points
IJCAI 2022 | greatly improve the effect of zero sample learning method with one line of code. Nanjing Institute of Technology & Oxford proposed the plug and play classifier module
爱可可AI前沿推介(6.27)
每日刷題記錄 (六)
Deeply convinced plan X - system foundation summary
打印输出数(递归方法解决)
A pang's operation record