当前位置:网站首页>2020.3.3 notes async/await and promise and Then processes and threads

2020.3.3 notes async/await and promise and Then processes and threads

2022-06-25 04:24:00 Robin Luo Bing

One 、 Processes and threads

1、 The main difference between processes and threads is that they are different ways of operating system resource management

2、 The process has a separate address space , Threads have no separate address space

3、 In short , A program has at least one process , A process has at least one thread

4、 Low thread execution cost , But it is not conducive to the management and protection of resources ; And the process is the opposite

5、 A process is an execution of a program on a computer . When you run a program , You start a process

6、 Threads are the smallest unit of execution , And the process is made up of at least one thread . How to schedule processes and threads , It's entirely up to the operating system , The program itself can't decide when to execute , How long does it take

7、 According to the process and thread settings , Operating systems are roughly divided into the following types :

(1) Single process 、 Single thread ,MS-DOS Roughly this operating system ;

(2) Multi process 、 Single thread , Most of the UNIX( And UNIX Of LINUX) It's this operating system ;

(3) Multi process 、 Multithreading ,Win32(Windows NT/2000/XP etc. )、Solaris 2.x and OS/2 It's all this operating system ;

(4) Single process 、 Multithreading ,VxWorks It's this operating system .

Two 、async/await and promise  and .then

1、https://blog.fundebug.com/2018/12/10/understand-async-await-and-promise-by-8-pictures/  8 This picture allows you to see step by step async/await and promise Execution order of   

2、https://segmentfault.com/a/1190000012806637  10 Minute comprehension JS Execution mechanism of engine

3、https://segmentfault.com/a/1190000007535316  understand JavaScript Of async/await

4、https://es6.ruanyifeng.com/#docs/promise Promise object

5、https://www.runoob.com/w3cnote/javascript-promise-object.html  JavaScript Promise object

原网站

版权声明
本文为[Robin Luo Bing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210534569399.html