What this book covers
Chapter 1, Why Go?, provides an overview of Go’s suitability for building efficient and high-performance system software, providing you with the necessary knowledge and skills to leverage Go’s capabilities for system-level development. The chapter covers Go’s concurrency model, networking and I/O, low-level control, system calls, cross-platform support, and tooling, offering practical insights and examples for building robust system programs.
Chapter 2, Refreshing Concurrency and Parallelism, provides an overview of the core aspects of Goroutines, data races, channels, and their interplay in the Go programming language. Understanding these principles is critical for implementing efficient concurrency, managing shared resources, and ensuring effective inter-goroutine communication.
Chapter 3, Understanding System Calls, provides an overview of system calls and their practical applications. You will learn how to create symbolic links, unlink files, and manipulate filename paths. Also, you will better understand package OS and syscall in Go and learn how to develop and test a CLI program.
Chapter 4, File and Directory Operations, provides an overview of handling filesystems in Go, focusing on detecting unsafe permissions, calculating directory sizes, and identifying duplicate files.
Chapter 5, Working with System Events, provides comprehensive insights into building advanced and efficient system tools using Go, focusing on task scheduling, file monitoring, process management, and distributed locking.
Chapter 6, Understanding Pipes in Inter-Process Communication, provides an exploration of the concept of pipes in Inter-Process Communication (IPC). It provides comprehensive information about anonymous pipes, named pipes (mkfifo
), and how pipes interact with other programs.
Chapter 7, Unix Sockets, provides an understanding of how UNIX sockets function, their types, and their role in IPC on UNIX and UNIX-like operating systems such as Linux.
Chapter 8, Memory Management, focuses on the mechanisms and strategies underpinning garbage collection. We’ll explore the evolution of Go’s garbage collection, the distinctions between stack and heap memory allocations, and advanced techniques for efficient memory management.
Chapter 9, Analyzing Performance, covers key optimization techniques for Go applications, including escape analysis, benchmarking, CPU profiling, and memory profiling. It explains how to improve memory usage with escape analysis, measure and compare code performance through benchmarking, identify hotspots with CPU profiling, and detect memory leaks using memory profiling.
Chapter 10, Networking, delves into the fascinating world of Go network programming. Networking is essential to system programming, and Go provides powerful primitives for handling network communications. You will gain the expertise needed to create robust networked applications by exploring TCP, HTTP, and additional relevant protocols.
Chapter 11, Telemetry, dives into how you can leverage industry tools to implement effective telemetry practices. From logs to traces and metrics, you’ll explore the tools and guidelines necessary to monitor your application efficiently.
Chapter 12, Distributing Your Apps, explores the key concepts and practical applications of distributing applications using Go modules, continuous integration, and release strategies.
Chapter 13, Capstone Project - Distributed Cache, guides you through the Capstone Project. This project will build a distributed cache system in Go with features such as Memcached or Redis. It will cover sharding strategies, eviction policies, consistency models, and technology choices, all while navigating the trade-offs that come with each decision.
Chapter 14, Effective Coding Practices, explores the principles and techniques of efficient resource management in Go programming, specifically focusing on avoiding common pitfalls that can lead to performance issues and hinder overall efficiency. It dives into the intricacies of optimizing resource usage using the Go standard library, providing strategies for developers seeking to enhance the effectiveness of their Go applications.
Chapter 15, Stay Sharp with System Programming, provides a continuous learning path to Go-based system programming based on real-world case studies. By gaining insight into how Go is utilized in actual applications, you can apply these lessons to their projects.
Appendix, Hardware Automation, explores how to utilize various tools to automate mundane tasks with USB drives and Bluetooth devices and monitor peripheral events. By understanding how to automate these processes, you will save valuable time and increase productivity in your daily lives.