Skip to content

Commit 9c58757

Browse files
committed
Update public notes
1 parent a9e4e81 commit 9c58757

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
tags: []
3+
---
4+
简单记录这四个概念的意思
5+
6+
## 并发 Concurrency
7+
并发是一个比较宽泛的概念,单纯说明计算机如何做到同时执行多个任务。
8+
9+
并发有很多实现方式,例如**上下文切换****多核运行**
10+
11+
## 并行 Parallelism
12+
其实多核运行处理任务就是并行。
13+
14+
## 同步 Synchronous
15+
就是按顺序执行任务,只有等前一个任务执行完了,才会执行后一个任务。
16+
17+
## 异步 Asynchronous
18+
多个任务之间不会互相等待。
19+
20+
实现异步的经典方式是**多线程**
21+
22+
## 多线程 与 单线程异步
23+
异步适合 io 密集型,多线程适合计算密集型。
24+
25+
这是基于多线程切换会有消耗以及单线程异步结构特点的结论。

0 commit comments

Comments
 (0)