- 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.
- Kubernetes修煉手冊
- Mobile-first Bootstrap
- Linux實戰
- Linux內核完全注釋(20周年版·第2版)
- Linux網絡內核分析與開發
- Java EE 8 Design Patterns and Best Practices
- 竹林蹊徑:深入淺出windows驅動開發
- Mobile First Design with HTML5 and CSS3
- Windows 7應用入門與技巧
- ElasticSearch Cookbook
- Social Data Visualization with HTML5 and JavaScript
- Django Project Blueprints
- CentOS 6 Linux Server Cookbook
- 大學計算機應用基礎實踐教程(Windows 7+MS Office 2010)
- Linux集群之美