testifier:这道题我也遇到过,当时面试官说的是浏览器请求数的并发限制,当时没有答出来。今天有时间查了资料实现如下:
https://gist.github.com/upupming/cbc24ada6f99d41073397b3842cdd884
运行结果:
```txt
start running 0
start running 1
start running 2
finished running 2
start running 3
finished running 0
start running 4
finished running 4
start running 5
finished running 1
start running 6
finished running 5
start running 7
finished running 3
start running 8
finished running 7
start running 9
finished running 6
start running 10
finished running 8
start running 11
finished running 9
start running 12
finished running 11
start running 13
finished running 10
start running 14
finished running 12
start running 15
finished running 13
start running 16
finished running 16
start running 17
...
``
参考资料:https://gist.github.com/jcouyang/632709f30e12a7879a73e9e132c0d56b查看图片
0 点赞 评论 收藏
分享
投递哔哩哔哩等公司10个岗位 >
0 点赞 评论 收藏
分享
关注他的用户也关注了: