동기(synchronous), 비동기(asynchronous)

2020. 4. 11. 00:21웹, 네트워크, 통신

728x90
  동기 synchronous 비동기 asynchronous
설명

Events(request and response) occur at the same time.

Contemporaneous.

Events happen or exist during the same period of time.

Events doesn't exist or happen at the same time.

A specific operation begins upon receipt of an indication that the preceding operation has been completed.

You wait for it to finish before moving on to another task.

You can move on to another task before it finishes.

Your code is executed from top to bottom, step by step, and it only gets to the second step when it has finished the first step.

 

Because of its predictable behavior, sync is also called a predictable programming model. Most programming languages use sync as its base programming model.

Your code is executed concurrently. Executing concurrently means that all the tasks are likely executed at the same time.

 

You can't predict the result because tasks are executed at the same time.

 

It’s useful for use cases in which you do tasks that do not depend on each other and for which you don’t care about the execution order.

 

728x90
반응형