- Distributed Computing with Go
- V.N. Nikhil Anurag
- 181字
- 2021-06-24 18:36:12
Summary
Goroutines are concurrent and, to an extent, parallel; however, we should think of them as being concurrent. The order of execution of goroutines is not predictable and we should not rely on them to be executed in any particular order.
We should also take care to handle errors and panics in our goroutines because even though they are being executed in parallel, a panic in one goroutine will crash the complete program. Finally, goroutines can block on system calls, however this will not block the execution of the program nor slow down the performance of the overall program.
We looked at a few of the design concepts behind Go's runtime scheduler to understand why all of this happens.
You might be wondering why we haven't discussed channels in this chapter. The reason is that by not relying on channels we were able to look at goroutines in their most elemental form. This allowed us to dive deeper into the concept and implementation of goroutines.
In the next chapter, we shall be looking at channels and how they further empower goroutines.
- 發布!設計與部署穩定的分布式系統(第2版)
- Windows Server 2019 Administration Fundamentals
- 嵌入式實時操作系統μC/OS原理與實踐
- 注冊表應用完全DIY
- AutoCAD 2014中文版從入門到精通
- Application Development in iOS 7
- Windows 7使用詳解(修訂版)
- Learning Continuous Integration with Jenkins(Second Edition)
- Docker容器技術與應用
- Docker容器技術與運維
- Website Development with PyroCMS
- Windows7系統維護百寶箱
- 嵌入式Linux設備驅動程序開發指南(原書第2版)
- 微信小程序項目開發實戰:用WePY、mpvue、Taro打造高效的小程序
- Linux指令從入門到精通(“十二五”國家重點圖書出版規劃項目)