Skip to Content
C++ Reactive Programming
book

C++ Reactive Programming

by Praseed Pai, Peter Abraham
June 2018
Intermediate to advanced
348 pages
8h 45m
English
Packt Publishing
Content preview from C++ Reactive Programming

A lock-free data structure  queue

As we already know, the data in an actual system is often represented in the form of a data structure, and when it comes to concurrent operations on a data structure, performance is a big deal. In Chapter 3Language-Level Concurrency and Parallelism in C++, we learned how to write a thread-safe stack. However, we used locks and condition variables to implement it. To explain how to write a lock-free data structure, let's write a very basic queue system using a producer/consumer paradigm without using locks or condition variables. This will improve the performance of the code for sure. Rather than using a wrapper over a standard data type, we will roll it out from scratch. We have made an assumption that ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Programming in C++

Functional Programming in C++

Ivan Cukic

Publisher Resources

ISBN: 9781788629775Supplemental Content