---
# System prepended metadata

title: Asynchronous vs Synchronous execution
tags: [C basics]

---

# Asynchronous vs Synchronous execution
###### tags: `C basics`
#### 整理：BY.Y, 2021/06/29
#### src: 
>1. https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean

根據stack overflow上的回應：
>Synchronous/Asynchronous HAS NOTHING TO DO WITH MULTI-THREADING.

synchronous強調的是，工作**順序的關係**，不管是single-thread或者multi-thread

舉個生活上常見的例子：
>我一定先刷完牙，才吃午餐。
>刷牙-->吃午餐
>是一種順序上的關係

如果扯到single-thread 和 multi-thread，畫成圖會長成這樣：
***以下源自stack overflow上的回應***

Synchronous (one thread):
![](https://i.imgur.com/8KVHh11.png)

Synchronous (multi-threaded):
![](https://i.imgur.com/KOa8BQp.png)

Asynchronous (one thread): 
![](https://i.imgur.com/vHmgAjw.png)

Asynchronous (multi-Threaded):
![](https://i.imgur.com/HM1rnHG.png)
