Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying System Programming Essentials with Go
  • Table Of Contents Toc
System Programming Essentials with Go

System Programming Essentials with Go

By : Alex Rios
5 (4)
close
close
System Programming Essentials with Go

System Programming Essentials with Go

5 (4)
By: Alex Rios

Overview of this book

Alex Rios, a seasoned Go developer and active community builder, shares his 15 years of expertise in designing large-scale systems through this book. It masterfully cuts through complexity, enabling you to build efficient and secure applications with Go's streamlined syntax and powerful concurrency features. In this book, you’ll learn how Go, unlike traditional system programming languages (C/C++), lets you focus on the problem by prioritizing readability and elevating developer experience with features like automatic garbage collection and built-in concurrency primitives, which remove the burden of low-level memory management and intricate synchronization. Through hands-on projects, you'll master core concepts like file I/O, process management, and inter-process communication to automate tasks and interact with your system efficiently. You'll delve into network programming in Go, equipping yourself with the skills to build robust, distributed applications. This book goes beyond the basics by exploring modern practices like logging and tracing for comprehensive application monitoring, and advance to distributed system design using Go to prepare you to tackle complex architectures. By the end of this book, you'll emerge as a confident Go system programmer, ready to craft high-performance, secure applications for the modern world.
Table of Contents (24 chapters)
close
close
Lock Free Chapter
1
Part 1: Introduction
4
Part 2: Interaction with the OS
10
Part 3: Performance
13
Part 4: Connected Apps
17
Part 5: Going Beyond

Developing a log processing tool

Having covered the fundamentals of pipes in IPC and best practices for their use in Go, let’s explore more advanced topics. We will explore a scenario where pipes can be effectively utilized and see how Go’s concurrency model complements these use cases. This section aims to give you practical insights into leveraging pipes for sophisticated system programming tasks.

In the next example, we’ll develop a simple real-time log processing tool. This tool will read log data from a file (simulating a log file being written by another process), process the log entries (for example, filtering based on severity), and then output the results to the console.

First, we create a filterLogs() function that reads logs from the reader, filters them, and writes to the writer:

func filterLogs(reader io.Reader, writer io.Writer) {
   scanner := bufio.NewScanner(reader)
   for scanner.Scan() {
   ...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
System Programming Essentials with Go
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon