3

Communication Sequential Process (CSP for short), communication sequential process, this idea was first proposed by Tony Ho are in 1977, and the partial introduction of CSP is considered to be the key factor for the success of Go language in concurrent programming.

  • Concurrent programming in most languages is based on access control for threads and memory synchronization.
  • The concurrent programming of Go language is based on goroutine [process in CSP thought] and chanel [chanel in CSP thought] instead.

Philosophy: Use chanel and goroutine as much as possible to perform concurrent tasks, chanel is used for synchronous communication between seafood goroutines, and chanel can be understood as a bridge between different goroutines, so as to realize communication between different goroutines. And chanel is thread-safe, and it is also very safe and convenient to use.

Reference: bilibili


LiberHome
409 声望1.1k 粉丝

有问题 欢迎发邮件 📩 liberhome@163.com