Book Image

C++ Programming for Linux Systems

By : Desislav Andreev, Stanimir Lukanov
Book Image

C++ Programming for Linux Systems

By: Desislav Andreev, Stanimir Lukanov

Overview of this book

Around 35 million Linux and almost 2 billion Android users rely on C++ for everything from the simplest embedded and IoT devices to cloud services, supercomputing, and space exploration. To help you produce high-quality software, two industry experts have transformed their knowledge and experience into practical examples in system programming with C++ Programming for Linux Systems. In this book, you'll explore the latest C++20 features, while working on multiple specific use cases. You’ll get familiar with the coroutines and modern approaches in concurrent and multithreaded programming. You'll also learn to reshape your thinking when analyzing system behavior in Linux (POSIX) environments. Additionally, you'll discover advanced discussions and novel solutions for complex challenges, while approaching trivial system operations with a new outlook and learning to choose the best design for your particular case. You can use this workbook as an introduction to system programming and software design in Linux or any Unix-based environment. You’ll also find it useful as a guideline or a supplement to any C++ book. By the end of this book, you’ll have gained advanced knowledge and skills for working with Linux or any Unix-based environment.
Table of Contents (15 chapters)
Free Chapter
1
Part 1:Securing the Fundamentals
7
Part 2:Advanced Techniques for System Programming

Using Coroutines in C++ for System Programming

We are almost at the end of our book. The final chapter is dedicated to a feature that is very useful for the purposes of system programming but is fairly new to the C++ standard. Coroutine objects found their application fast, becoming first-class state machine objects. Their power is in hiding logic behind the coroutine frame. Be advised that this is an advanced topic, and the coroutine interface of C++ is neither simple nor comfortable to use. It is well thought out but definitely not the most user-friendly in comparison to other programming languages.

In this chapter, you will learn the basics of using this facility. If you are new to it, then you’ll spend some time understanding its requirements. You’ll have an easier time with coroutines if you have previous experience with them in other programming languages. Still, we will use this chapter to propose their application in system programming.

We will present two...