Category: Science & Technology

C++20: The Small Pearls – Rainer Grimm – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

C++20 has way more to offer than the big four concepts, ranges, modules, and coroutines.
Here are a few of the shining pearls.

The spaceship operation automatically creates the six comparison operators. Thanks to consteval, constinit, and improved templates, programming at compile time becomes more powerful. std::span supports safe access to contiguous memory blocks. An enhanced time library and a new type date. Comfortable formatting of data thanks to std::format. Easily synchronize or coordinate threats with semaphores or latches and barriers. An improved thread that maintains itself and supports interruption. Thanks to the synchronized output streams, write operations in the concurrent environment do not end in a mess.

---
Rainer Grimm

I've worked as a software architect, team lead, and instructor since 1999. In 2002, I created company-intern meetings for further education. I have given training courses since 2002. My first tutorials were about proprietary management software, but I began teaching Python and C++ soon after. In my spare time, I like to write articles about C++, Python, and Haskell. I also like to speak at conferences. I publish weekly on my English blog (https://www.modernescpp.com/) and the (https://www.grimm-jaud.de/index.php/blog), hosted by Heise Developer. Since 2016 he is an independent instructor giving seminars about modern C++ and Python. Rainer published several books in various languages to modern C++ and concurrency, C++20, and the C++ Core Guidelines, in particular. Due to his profession, Rainer always searches for the best way to teach modern C++

---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

What’s New in Visual Studio: 64-bit IDE, C++20, WSL 2, & More – Marian Luparu & Sy Brand – CppCon 21

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Visual Studio 2022 is almost here, bringing new and deeper experiences for C++ developers targeting any platform. Since last year we’ve been working hard on implementing C++20 and making the IDE 64-bit, alongside a host of improvements to make your C++ development safer and more productive.

In this talk we’ll demonstrate many of these features, live: showing you how to use our new AddressSanitizer features to find bugs, target WSL 2 in seconds, express your build instructions with CMakePresets.json, consume specific versions of your dependencies with vcpkg, build and test your code with GitHub Actions, and more.

Come along to learn all about the latest in our tooling, and to get a peek into our plans for the future.

---
Sy Brand

Sy Brand is Microsoft’s C++ Developer Advocate. Their background is in compilers and debuggers for embedded accelerators, but they’re also interested in generic library design, metaprogramming, functional-style C++, undefined behaviour, and making our communities more welcoming and inclusive.

In their spare time they watch too many movies and are a published poet.

Marian Luparu

Ask me about @Code @VisualStudio and #Vcpkg

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Design and Implementation of Highly Scalable Quantifiable Data Structures in C++ – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Architectural imperatives due to the slowing of Moore's Law, the broad acceptance of relaxed semantics and the O(n!) worst case verification complexity of generating sequential histories motivate a new approach to concurrent correctness. Quantifiability is proposed as a novel correctness condition that models a system in vector space to launch a new mathematical analysis of concurrency. Analysis is facilitated with linear algebra, better supported and of much more efficient time complexity than traditional combinatorial methods.

In this talk, we present the design and implementation of a lock-free quantifiable stack (QStack) and a lock-free quantifiable queue (QQueue) in the C++ programming language. Our design achieves lock-freedom using compare_exchange_strong from the C++17 Atomic Operations Library. We depict several code snippets that illustrate how quantifiable data structures are highly scalable through use of relaxed semantics, an explicit implementation trade-off permitted by quantifiability. We explain how to reason about the correctness of quantifiable data structures and present a technique and a dynamic analysis tool developed in C++ for efficiently verifying a concurrent history as quantifiably correct, referred to as Vector Space Verification (VSV). We illustrate why it is impractical to use alternative verification techniques that compare concurrent histories to sequential histories for determining correctness for real programs.

We showcase the performance of quantifiable data structures by presenting a live demonstration that runs the QStack and QQueue and plots the results in real time. The QStack is compared with the lock-free Elimination Backoff Stack and the lock-free Treiber stack. The QQueue is compared with the lock-free LCRQ, and the wait-free Fetch-And-Add queue. The live performance demonstration illustrates how the QStack and QQueue achieve substantially higher scalability than the state-of-the-art linearizable counterparts. We also present a live demonstration of our VSV tool to dynamically check a concurrent history for the QStack and QQueue as quantifiably correct in less than O(n^2) time.

---
Victor Cook

Victor Cook is a Ph.D. candidate in Computer Science at the University of Central Florida. He received his Bachelor of Science in Geophysics from the Massachusetts Institute of Technology in 1987, and Master of Science in Civil Engineering from the University of Florida in 1989. Mr. Cook has spent years building software and network, primarily in the areas of medical and financial technology. Systems he architected continue to serve to this day. He has been in responsible positions with sensitive data, including five years as HIPAA compliance officer, and two years as PCI compliance officer. Mr. Cook has global experience, working four years in Latin America and 18 months in Singapore. After a 25 year career in technology, he returned to UCF to earn a doctorate in the field. Mr. Cook is researching blockchain concurrency issues of performance, correctness, progress, fairness and security.

Zachary Painter

Zachary Painter is a Ph.D. student at the University of Central Florida. His area of research includes concurrent programming, transactional data structures, and blockchain concurrency. His prior work includes a lock-free transactional adjacency list as well as a parallel Hash-Mark-Set on the Ethereum Blockchain in which he proposed a fast, lock-free algorithm for providing a read-uncommitted view of blockchain transactions. Zachary has also made contributions to blockchain related research, including a read-uncommitted view for smart contract performance. During his research, he has gained experience with several blockchain platforms including Ethereum and Stellar.

Christina Peterson

Dr. Christina Peterson is a Postdoctoral Associate at the University of Central Florida. Dr. Peterson completed her dissertation work under the supervision of Dr. Damian Dechev with a focus on correctness and progress guarantees of multiprocessor algorithms and data structures. Her published work includes the development of a durable linearizable correctness tool, concurrent correctness conditions defined in vector space, a transactional correctness tool for abstract data types, a correctness condition specification tool, a framework to verify progress guarantees, and an extension of combinatorial topology theory for wait-free computability to support the instructions Compare-And-Swap and Load-Link-Store-Conditional. She also co-authored a publication that provides a read-uncommitted view for blockchain transactions.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Building a Lock-free Multi-producer, Multi-consumer Queue for Tcmalloc – Matt Kulukundis – CppCon 21

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Lock free multi-producer, multi-consumer queues are an area of active research in concurrent data structures, but their performance varies heavily with the specific constraints of the surrounding system. This talk tells the story of building such a queue to replace a component in tcmalloc, Google's malloc implementation. In the process, we will cover

- designing the initial data structure based on LMAX's disruptor pattern
- refactoring the existing code to increase testability and experimentation without introducing overhead
- adding micro benchmarks for the new code
- revising micro benchmarks in the face of conflicting system level metrics
- optimizing the data structure based on those conclusions
- debugging difficult concurrency bugs
- measuring the final result with system level metrics

---
Matt Kulukundis
Matt is a senior software engineer on the C++ libraries team at Google. Prior to Google he has worked on compilers, machine learning, and underwater robotics. In his free time, he scuba dives in warm places.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Modern CMake Modules – Bret Brown – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
At Bloomberg, we have thousands of independently maintained first- and third-party C++ projects built with CMake. One of the keys to achieving this scale, while also keeping engineers productive, has been leveraging one of the most underrated and underutilized features of CMake — its extensibility via its module system. Bloomberg utilizes dozens of single-purpose CMake modules to allow its tens of thousands of CMakeLists.txt files to stay declarative, flexible, future-proof, and simple -- all while using modern CMake principles!

This talk will cover what CMake modules are, how to write one using the latest CMake features, and how to package one for others to use. Importantly, this talk will also cover when *not* to write a CMake module.

If you find yourself wincing at all the repetitive boilerplate in the CMakeLists.txt across your projects, this is the talk for you!

---
Bret Brown

Software engineer currently focusing on improving C and C++ ergonomics, correctness, and productivity for Bloomberg's Developer Experience department.

Bret likes making authoring and maintaining C++ codebases simpler and more intuitive by treating projects more like cattle and less like pets. He is especially interested in the software development lifecycle, development automation, modern build systems, packaging, code transformation, software governance, and code analysis.
Bret worked in embedded C++ and safety critical C++ for previous employers.

Currently lead of Bloomberg's Build Tools team, responsible for tools such as CMake, pkg-config, and compilation toolchains.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back to Basics: Lambdas – Nicolai Josuttis – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Lambdas, introduced with C++11, are used everywhere in modern C++ programming. While their use looks pretty straightforward, you should know about some details that help you to benefit from their full power.
This session teaches lambdas in detail. Based on the basic principles, it motivates and explains why lambdas are more powerful than functions and how to use them to benefit from that.

---
Nicolai Josuttis

Nicolai Josuttis (http://www.josuttis.com) is well known in the programming community because he not only speaks and writes with authority (being the (co-)author of the world-wide best sellers The C++ Standard Library (www.cppstdlib.com), C++ Templates (www.tmplbook.com), C++17 - The Complete Guide (www.cppstd17.com), C++ Move Semantics - The Complete Guide (www.cppmove.com), and SOA in Practice), but is also an innovative presenter, having talked at various conferences and events.
He has been an active member of the C++ standards committee for more than 20 years.

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back to Basics: Object-Oriented Programming – Rainer Grimm – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
C++ is an object-oriented programming (OOP) language but also supports generic and functional features. OOP is a potent tool when used wisely. Let me present you the good parts.

You can design intuitive classes, which encapsulate its internals and allow restricted access. Further, inheritance applied appropriately enables you to build libraries or frameworks that are easy to use and difficult to misuse. The hidden source is the separation of interface and implementation. You can apply "Lesson Learned" from the best and implement design patterns using OOP techniques.

Learn in my lecture the appropriate use of the keywords virtual, override, and final. Learn when you should build a class hierarchy to separate the interface from the implementation. Besides interface inheritance, you can also use implementation inheritance. Learn to distinguish between those.
During this lecture, I also present a few design patterns as examples of good object-oriented design.

---
Rainer Grimm

I've worked as a software architect, team lead, and instructor since 1999. In 2002, I created company-intern meetings for further education. I have given training courses since 2002. My first tutorials were about proprietary management software, but I began teaching Python and C++ soon after. In my spare time, I like to write articles about C++, Python, and Haskell. I also like to speak at conferences. I publish weekly on my English blog (https://www.modernescpp.com/) and the (https://www.grimm-jaud.de/index.php/blog), hosted by Heise Developer. Since 2016 he is an independent instructor giving seminars about modern C++ and Python. Rainer published several books in various languages to modern C++ and concurrency, C++20, and the C++ Core Guidelines, in particular. Due to his profession, Rainer always searches for the best way to teach modern C++

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

From Problem to Coroutine: Reducing I/O Latency – Cheinan Marks – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Coroutines are now officially part of the C++20 standard and one of their advertised uses is reducing I/O latency. Almost all of the literature on coroutines that I found illustrated either synchronous generators or described the nitty gritty details of coroutines using very simple usages. The best talk I found was Gor Nishanov's excellent talk from CppCon 2018, "Nanocoroutines to the Rescue!" (go watch it!) which solves a different problem than mine, but mostly illustrates the power of coroutines.

In this talk I want to approach coroutines from another direction. I will start with the problem, which almost all engineers face in some form, that of reducing I/O latency while searching and gathering data from a sequential file. Instead of going into the details of how the coroutines work, I will start with the naive synchronous solution and build up coroutines step by step to try and reduce latency, illustrating the pieces as they are added.

Finally I will compare this solution to an old-fashioned solution using threads and we'll see how the coroutines performance measures up and whether all the additional boilerplate needed is worth the additional trouble. I hope discussing the value of coroutines and future proposals for RAII and executors will spark a good discussion with the audience.

---
Cheinan Marks

Cheinan Marks is a senior software developer, living in Berlin, where he starting a non-profit to research bioinformatics and bio-computation, specializing in genetics. He got his start in the TUTOR language on the PLATO system at the University of Illinois. Having gotten his doctorate in chemical engineering, he enjoys developing new ideas in software, particularly scientific ideas, and turning them into practical, real-world products. Past projects include Quantum Mechanics, Natural Language Programming, and Image Manipulation.

---
Videos Recorded & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

cudaFlow: Modern C++ Programming Model for GPU Task Graph Parallelism – CppCon 2021

  • Lobby
  • Science & Technology

Presented by Tsung-Wei Huang & Dian-Lun Lin

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Graphics processing unit (GPU) has become central to today’s scientific computing applications, such as machine learning and simulation. As the application complexity continues to grow, the need to quickly execute thousands of dependent GPU tasks has become a major bottleneck in the development flow. To overcome this challenge, modern CUDA has introduced CUDA Graph for users to directly offload a GPU task graph on a GPU to minimize scheduling overheads. However, programming CUDA Graph is extremely tedious and involves many low-level details that are difficult to program correctly. Consequently, we introduce in this paper, cudaFlow, a modern C++ programming model to streamline the building of large GPU workloads using CUDA Graph. cudaFlow enables efficient implementations of GPU decomposition strategies supplied with incremental update methods to express complex GPU algorithms that are hard to execute efficiently by mainstream stream-based models. We have demonstrated the simplicity and efficiency of cudaFlow on large-scale GPU applications composed of thousands of tasks and dependencies.

The talk will cover five major components:
1. What is the new CUDA Graph programming model?
2. Why do we need a C++ programming model for GPU task graph parallelism?
3. Designs, implementations, and deployments of the proposed cudaFlow programming model.
4. Real use cases of cudaFlow and its performance advantages in large GPU workloads.
5. Remarks and roadmap suggestions for the GPU programming community.

By the end of the presentation, the audience will know how to leverage the new GPU task graph parallelism to boost the performance of large-scale GPU applications, such as machine learning and scientific simulations.

---
Tsung-Wei Huang
As a university faculty member, a central theme of my research is to make parallel computing easier to handle. I am passionate about using modern C++ technology to solve parallel and heterogeneous computing problems. One such effort is my Taskflow project (https://taskflow.github.io/), A General-purpose Parallel and Heterogeneous Task Programming System using Modern C++, which I developed to help developers quickly write parallel and heterogeneous programs with high performance and simultaneous high productivity.

Dian-Lun Lin
PhD student, University of Utah
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back To Basics: Undefined Behavior – Ansel Sermersheim & Barbara Geller – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
In this talk we will build a refined and improved definition of undefined behavior, to motivate and encourage C++ developers to write correct code. We will explain the terminology associated with Undefined Behavior and explore why it exists in the C++ language. Looking at the standard is the only way to determine what constitutes undefined behavior.

During this talk we will present several new examples to illustrate how various types of undefined behavior can occur in a short span of code. We will also describe the various categories of behavior and the difference between run time errors and undefined behavior. Understanding these distinctions is critical to being an effective programmer.

This talk is part of the Back to Basics track and the material will be targeted to include all skill levels. Familiarity with C++ is recommended however no prior knowledge of compilers or undefined behavior is required.

---
Ansel Sermersheim

I have been working as a programmer for nearly twenty years. My degree is in Computer Science from Cal Poly San Luis Obispo. I have transitioned to independent consulting and I am currently working on a project for RealtyShares in San Francisco.

Co-founder of CopperSpice, a C++ GUI library.
Co-founder of DoxyPress, a C++ application for generating documentation.
Developer of the open source libraries: libGuarded, CsSignal and CsString.

I have programmed in C++, C, Lisp, Java, and Perl, with extensive knowledge in TCP/IP and mutilthreaded design. I am an avid follower of the C++ standard. Speaker at CppCon 2015, CppNow 2016, CppNow 2017, and several ACCU Bay Area meetings.

Barbara Geller

I am an independent consultant with over twenty-five years of experience as a programmer and software developer. I have worked with numerous smaller companies developing in-house applications. I have also designed and developed Windows applications for several vertical markets including medical billing, transportation, and construction.

My degree is in Electrical Engineering from Cal Poly Pomona with additional studies in Computer Science.

I am a Co-founder of CopperSpice, a C++ library derived from the existing Qt framework. I designed the Diamond Editor, a cross-platform programmers editor using the CopperSpice libraries. I have programmed in C++, Qt, Visual Objects, Clipper, PHP, and Java.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology