The Go Programming Language Phrasebook
Essential Go code and idioms for all facets of the development process
This guide gives you the code “phrases” you need to quickly and effectively complete a wide variety of projects with Go, today’s most exciting new programming language.
Tested, easy-to-adapt code examples illuminate every step of Go development, helping you write highly scalable, concurrent software. You’ll master Go-specific idioms for working with strings, collections, arrays, error handling, goroutines, slices, maps, channels, numbers, dates, times, files, networking, web apps, the runtime, and more.
Concise and Accessible
Easy to carry and easy to use: Ditch all those bulky books for one portable pocket guide
Flexible and Functional
Packed with more than 100 customizable code snippets: Quickly create solid Go code to solve just about any problem
Register your book at informit.com/register for convenient access to downloads, updates, and corrections as they become available.
David Chisnall is author of Objective-C Phrasebook, Second Edition. He is an active contributor to the GNUstep project and cofounded the Étoilé project to build a desktop environment atop GNUstep. Chisnall has written several articles for informIT.com including a three-part series on Go for Objective-C Programmers.
However, developing, testing, and debugging multithreaded programs can still be very difficult; it is all too easy to create concurrent programs that appear to work, but fail when it matters most: in production, under heavy load. Java Concurrency in Practice arms readers with both the theoretical underpinnings and concrete techniques for building reliable, scalable, maintainable concurrent applications. Rather than simply offering an inventory of concurrency APIs and mechanisms, it provides design rules, patterns, and mental models that make it easier to build concurrent programs that are both correct and performant.
This book covers:Basic concepts of concurrency and thread safety Techniques for building and composing thread-safe classes Using the concurrency building blocks in java.util.concurrent Performance optimization dos and don'ts Testing concurrent programs Advanced topics such as atomic variables, nonblocking algorithms, and the Java Memory Model
Discover how to:Gain greater code performance using graphics processing units (GPUs) Choose accelerators that enable you to write code for GPUs Apply thread tiles, tile barriers, and tile static memory Debug C++ AMP code with Microsoft Visual Studio Use profiling tools to track the performance of your code
Starting from the premise that understanding the foundations of concurrent programming is key to developing distributed computing systems, this book first presents the fundamental theories of concurrent computing and then introduces the programming languages that help develop distributed computing systems at a high level of abstraction. The major theories of concurrent computation—including the p-calculus, the actor model, the join calculus, and mobile ambients—are explained with a focus on how they help design and reason about distributed and mobile computing systems. The book then presents programming languages that follow the theoretical models already described, including Pict, SALSA, and JoCaml. The parallel structure of the chapters in both part one (theory) and part two (practice) enable the reader not only to compare the different theories but also to see clearly how a programming language supports a theoretical model.
The book is unique in bridging the gap between the theory and the practice of programming distributed computing systems. It can be used as a textbook for graduate and advanced undergraduate students in computer science or as a reference for researchers in the area of programming technology for distributed computing. By presenting theory first, the book allows readers to focus on the essential components of concurrency, distribution, and mobility without getting bogged down in syntactic details of specific programming languages. Once the theory is understood, the practical part of implementing a system in an actual programming language becomes much easier.
–Simon Crosby, CTO, XenSource
An Under-the-Hood Guide to the Power of Xen Hypervisor Internals
The Definitive Guide to the Xen Hypervisor is a comprehensive handbook on the inner workings of XenSource’s powerful open source paravirtualization solution. From architecture to kernel internals, author David Chisnall exposes key code components and shows you how the technology works, providing the essential information you need to fully harness and exploit the Xen hypervisor to develop cost-effective, highperformance Linux and Windows virtual environments.
Granted exclusive access to the XenSource team, Chisnall lays down a solid framework with overviews of virtualization and the design philosophy behind the Xen hypervisor. Next, Chisnall takes you on an in-depth exploration of the hypervisor’s architecture, interfaces, device support, management tools, and internals—including key information for developers who want to optimize applications for virtual environments. He reveals the power and pitfalls of Xen in real-world examples and includes hands-on exercises, so you gain valuable experience as you learn.
This insightful resource gives you a detailed picture of how all the pieces of the Xen hypervisor fit and work together, setting you on the path to building and implementing a streamlined, cost-efficient virtual enterprise.
· Understanding the Xen virtual architecture
· Using shared info pages, grant tables, and the memory management subsystem
· Interpreting Xen’s abstract device interfaces
· Configuring and managing device support, including event channels, monitoring with XenStore, supporting core devices, and adding new device types
· Navigating the inner workings of the Xen API and userspace tools
· Coordinating virtual machines with the Scheduler Interface and API, and adding a new scheduler
· Securing near-native speed on guest machines using HVM
· Planning for future needs, including porting, power management, new devices, and unusual architectures
Today’s most exciting new programming language, Go, is designed from the ground up to help you easily leverage all the power of today’s multicore hardware. With this guide, pioneering Go programmer Mark Summerfield shows how to write code that takes full advantage of Go’s breakthrough features and idioms.
Both a tutorial and a language reference, Programming in Go brings together all the knowledge you need to evaluate Go, think in Go, and write high-performance software with Go. Summerfield presents multiple idiom comparisons showing exactly how Go improves upon older languages, calling special attention to Go’s key innovations. Along the way, he explains everything from the absolute basics through Go’s lock-free channel-based concurrency and its flexible and unusual duck-typing type-safe approach to object-orientation.
Throughout, Summerfield’s approach is thoroughly practical. Each chapter offers multiple live code examples designed to encourage experimentation and help you quickly develop mastery. Wherever possible, complete programs and packages are presented to provide realistic use cases, as well as exercises. Coverage includes
Quickly getting and installing Go, and building and running Go programs Exploring Go’s syntax, features, and extensive standard library Programming Boolean values, expressions, and numeric types Creating, comparing, indexing, slicing, and formatting strings Understanding Go’s highly efficient built-in collection types: slices and maps Using Go as a procedural programming language Discovering Go’s unusual and flexible approach to object orientation Mastering Go’s unique, simple, and natural approach to fine-grained concurrency Reading and writing binary, text, JSON, and XML files Importing and using standard library packages, custom packages, and third-party packages Creating, documenting, unit testing, and benchmarking custom packages
Concise and Accessible
Easy to carry and easy to use–lets you ditch all those bulky books for one portable pocket guide
Flexible and Functional
Packed with more than 100 customizable code snippets–so you can readily code elegant Objective-C in just about any situation