Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.简述同步和异步的区别 #9

Open
webVueBlog opened this issue Mar 10, 2020 · 1 comment
Open

9.简述同步和异步的区别 #9

webVueBlog opened this issue Mar 10, 2020 · 1 comment
Labels
JavaScript JavaScript

Comments

@webVueBlog
Copy link
Member

同步是阻塞模式,异步是非阻塞模式。

同步就是指一个进程在执行某个请求的时候,若该请求需要一段时间才能返
回信息,那么这个进程将会一直等待下去,直到收到返回信息才继续执行下去

异步是指进程不需要一直等下去,而是继续执行下面的操作,不管其他进程的状
态。当有消息返回时系统会通知进程进行处理,这样可以提高执行的效率。

@webVueBlog webVueBlog added the JavaScript JavaScript label Mar 10, 2020
@webVueBlog
Copy link
Member Author

Synchronous is blocking mode, asynchronous is non-blocking mode.

Synchronization is when a process executes a request that takes some time to return
Return the message, and the process will wait until it receives the return message

Asynchronous means that the process does not have to wait forever, but instead continues to perform the following operation, regardless of the appearance of other processes
State. When a message is returned, the system notifies the process to process it, which makes execution more efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript JavaScript
Projects
None yet
Development

No branches or pull requests

1 participant