Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Advanced C++

You're reading from  Advanced C++

Product type Book
Published in Oct 2019
Publisher
ISBN-13 9781838821135
Pages 762 pages
Edition 1st Edition
Languages
Authors (5):
Gazihan Alankus Gazihan Alankus
Profile icon Gazihan Alankus
Olena Lizina Olena Lizina
Profile icon Olena Lizina
Rakesh Mane Rakesh Mane
Profile icon Rakesh Mane
Vivek Nagarajan Vivek Nagarajan
Profile icon Vivek Nagarajan
Brian Price Brian Price
Profile icon Brian Price
View More author details

Table of Contents (11) Chapters

About the Book 1. Anatomy of Portable C++ Software 2A. No Ducks Allowed – Types and Deduction 2B. No Ducks Allowed – Templates and Deduction 3. No Leaks Allowed - Exceptions and Resources 4. Separation of Concerns - Software Architecture, Functions, and Variadic Templates 5. The Philosophers' Dinner – Threads and Concurrency 6. Streams and I/O 7. Everybody Falls, It's How You Get Back Up – Testing and Debugging 8. Need for Speed – Performance and Optimization 1. Appendix

5. The Philosophers' Dinner – Threads and Concurrency

Learning Objectives

By the end of this chapter, you will be able to:

  • Create synchronous and asynchronous multithreaded applications
  • Apply synchronization to handle data hazards and race conditions
  • Develop efficient multithreaded code with C++ thread library primitives
  • Create threads using move semantics for multithreading closures
  • Implement thread communication with futures, promises, and async

In this chapter, we will clarify the difference between basic terms in multithreaded programming, learn how to write multi-threaded code, find out which resources are provided by the C++ Standard Library for data access synchronization, learn how to prevent our code from encountering race conditions and deadlocks.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Advanced C++
Published in: Oct 2019 Publisher: ISBN-13: 9781838821135
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}