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

并发和并行 #301

Open
oakland opened this issue Jul 16, 2021 · 0 comments
Open

并发和并行 #301

oakland opened this issue Jul 16, 2021 · 0 comments

Comments

@oakland
Copy link
Owner

oakland commented Jul 16, 2021

其实一直以为并发和并行是一个东西,但是并不是。
并发的英文是 concurrency, 并行的英文是 parallelism。
简单来说并发指的是一个 cpu 同时处理多个任务,只不过不停地在多个任务间快速的切换,让多个任务看起来是随着时间的推移都有进展。而并行则是真正的一个 cpu 执行一个任务,多个任务在同一个时间段内是都有进展的。
之所以有这个认识,是因为最近看到的一篇文章,这可能是最通俗的React fiber 打开方式,这里面给出了例子,而且还有经典的理论知识。concurrency-is-not-parallelism

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

No branches or pull requests

1 participant