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
  • Feedback & Rating feedback
System Programming Essentials with Go

System Programming Essentials with Go

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

System Programming Essentials with Go

5 (5)
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
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

State and signaling

Exploring the semantics of state and signaling puts you ahead of the curve in avoiding more straightforward bugs or making good design choices.

State

Although Go eased the adoption of concurrency with channels, there are some characteristics and pitfalls.

We should remember that channels have three states – nil, open (empty, not empty), and closed. These states strongly relate to what we can and cannot do with channels, whether from the sender’s or receiver’s perspective.

Consider a channel when you want to read from:

  • Reading to a write-only channel results in a compilation error
  • If the channel is nil, reading from it indefinitely blocks your goroutine until it is initialized
  • Reading will be blocked in an open and empty channel until data is available
  • In an open and not empty channel, reading will return data
  • If the channel is closed, reading it will return the default value for its type and false to indicate...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

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