hotamul의 개발 이야기

[Golang] Concurrency is not parallelism (Goroutines, Channels, ...) 본문

Dev./Golang

[Golang] Concurrency is not parallelism (Goroutines, Channels, ...)

hotamul 2022. 11. 21. 00:23

Concurrency vs. parallelism

Concurrency is about dealing with lots of things at once.

Parallelism is about doing lots of things at once.

Not the same, but related.

Concurrency is about structure, parallelism is about execution.

Concurrency provides a way to structure a solution to solve a problem that may (but not necessarily) be parallelizable.

 

An analogy

Concurrent: Mouse, keyboard, display, and disk drivers.

Parallel: Vector dot product

 

 

Please watch this video(https://youtu.be/oV9rvDllKEg

 or this slide(https://go.dev/talks/2012/waza.slide)

 

Concurrency is not Parallelism

More gophers and more carts This will go faster, but there will be bottlenecks at the pile and incinerator. Also need to synchronize the gophers. A message (that is, a communication between the gophers) will do. 14

go.dev

 

ref: https://go.dev/blog/waza-talk

'Dev. > Golang' 카테고리의 다른 글

[Golang] How to setup Go in mac  (0) 2022.11.18
Comments