Book description
A problem-solution-based guide to help you overcome hurdles effectively while working with kernel APIs, filesystems, networks, threads, and process communications
Key Features
- Learn to apply the latest C++ features (from C++11, 14, 17, and 20) to facilitate systems programming
- Create robust and concurrent systems that make the most of the available hardware resources
- Delve into C++ inbuilt libraries and frameworks to design robust systems as per your business needs
Book Description
C++ is the preferred language for system programming due to its efficient low-level computation, data abstraction, and object-oriented features. System programming is about designing and writing computer programs that interact closely with the underlying operating system and allow computer hardware to interface with the programmer and the user. The C++ System Programming Cookbook will serve as a reference for developers who want to have ready-to-use solutions for the essential aspects of system programming using the latest C++ standards wherever possible.
This C++ book starts out by giving you an overview of system programming and refreshing your C++ knowledge. Moving ahead, you will learn how to deal with threads and processes, before going on to discover recipes for how to manage memory. The concluding chapters will then help you understand how processes communicate and how to interact with the console (console I/O). Finally, you will learn how to deal with time interfaces, signals, and CPU scheduling.
By the end of the book, you will become adept at developing robust systems applications using C++.
What you will learn
- Get up to speed with the fundamentals including makefile, man pages, compilation, and linking and debugging
- Understand how to deal with time interfaces, signals, and CPU scheduling
- Develop your knowledge of memory management
- Use processes and threads for advanced synchronizations (mutexes and condition variables)
- Understand interprocess communications (IPC): pipes, FIFOs, message queues, shared memory, and TCP and UDP
- Discover how to interact with the console (console I/O)
Who this book is for
This book is for C++ developers who want to gain practical knowledge of systems programming. Though no experience of Linux system programming is assumed, intermediate knowledge of C++ is necessary.
Table of contents
- Title Page
- Copyright and Credits
- About Packt
- Contributors
- Preface
-
Getting Started with System Programming
- Technical requirements
- Learning the Linux fundamentals - architecture
- Learning the Linux fundamentals - shell
- Learning the Linux fundamentals - users
- Using a makefile to compile and link a program
- Using GDB to debug a program
- Learning the Linux fundamentals - processes and threads
- Handling a Linux bash error
- Handling Linux code error
-
Revisiting C++
- Technical requirements
- Understanding C++ primitive types
- Lambda expressions
- Automatic type deduction and decltype
- Learning how atomic works
- Learning how nullptr works
- Smart pointers – unique_ptr and shared_ptr
- Learning how move semantics works
- Understanding concurrency
- Understanding the filesystem
- The C++ Core Guidelines
- Adding GSL in your makefile
- Understanding concepts
- Using span
- Learning how Ranges work
- Learning how modules work
- Dealing with Processes and Threads
-
Deep Dive into Memory Management
- Technical requirements
- Learning automatic versus dynamic memory
- Learning when to use unique_ptr, and the implications for size
- Learning when to use shared_ptr, and the implications for size
- Allocating aligned memory
- Checking whether the memory allocated is aligned
- Dealing with memory-mapped I/O
- Dealing with allocators hands-on
- Using Mutexes, Semaphores, and Condition Variables
- Pipes, First-In First-Out (FIFO), Message Queues, and Shared Memory
-
Network Programming
- Technical requirements
- Learning the basics of connection-oriented communication
- Learning the basics of connectionless-oriented communication
- Learning what a communication endpoint is
- Learning to use TCP/IP to communicate with processes on another machine
- Learning to use UDP/IP to communicate with processes on another machine
- Dealing with endianness
- Dealing with Console I/O and Files
- Dealing with Time Interfaces
- Managing Signals
- Scheduling
- Other Books You May Enjoy
Product information
- Title: C++ System Programming Cookbook
- Author(s):
- Release date: February 2020
- Publisher(s): Packt Publishing
- ISBN: 9781838646554
You might also like
book
Advanced C++ Programming Cookbook
A recipe-based guide to refining your C++ programming skills with the help of coding best practices, …
book
Embedded Programming with Modern C++ Cookbook
Explore various constraints and challenges that embedded developers encounter in their daily tasks and learn how …
book
Modern C++ Programming Cookbook - Second Edition
A pragmatic recipe book for acquiring a comprehensive understanding of the complexities and core fundamentals of …
book
C++ Cookbook
Despite its highly adaptable and flexible nature, C++ is also one of the more complex programming …