July 2021

Announcing the second set of AMAs for Meeting C++ 2021

Today I can share with you the second set of AMAs at Meeting C++ 2021

Announcing the second set of AMAs for Meeting C++ 2021

by Jens Weller

From the article:

This second set of C++ Experts nicely completes the first one. Its now a mix of folks involved with the C++ Standard complimented with experience in C++ and other languages. All of them have made contributions to C++ and our community, very much looking forward to see the set of questions for each of them in November!

CppCon 2020 A Parallel and Heterogeneous Task Programming System Using Modern C++--Tsung-Wei Huang

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

A Parallel and Heterogeneous Task Programming System Using Modern C++

by Tsung-Wei Huang

Summary of the talk:

The Taskflow project addresses the long-standing question: "How can we make it easier for developers to write parallel and heterogeneous programs with high performance and simultaneous high productivity?" Modern scientific computing relies on a heterogeneous mix of computational patterns, domain algorithms, and specialized hardware to achieve key scientific milestones that go beyond traditional capabilities. However, programming these applications often requires complex expert-level tools and a deep understanding of software methodologies. Specifically, the lack of a suitable software environment that can overcome the complexity of programming large parallel and heterogeneous systems has posed a significant barrier for many organizations to facilitate transformational discoveries.

Taskflow develops a simple and powerful task programming model to enable efficient implementations of heterogeneous decomposition strategies. Our programming model empowers users with both static and dynamic task graph constructions to incorporate a broad range of computational patterns including hybrid CPU-GPU computing, dynamic control flow, and irregularity. We develop an efficient heterogeneous work-stealing strategy that adapts worker threads to available task parallelism at any time during the graph execution. We have demonstrated promising performance of Taskflow on both micro-benchmark and real-world applications. As an example, we solved a large machine learning workload by up to 1.5× faster, 1.6× less memory, and 1.7× fewer lines of code than two industrial-strength systems, oneTBB and StarPU, on a machine of 40 CPUs and 4 GPUs.

This talk will cover three aspects: (1) heterogeneous task programming model using modern C++, (2) an efficient work-stealing strategy generalizable to arbitrary heterogeneous domains, and (3) user experience we have obtained and suggested roadmap for C++ in face of future heterogeneity.

The Taskflow project is available at https://taskflow.github.io/

C++20 three way comparison operator--Gajendra Gulgulia

The series continue.

C++20 three way comparison operator part 5 and part 6

by Gajendra Gulgulia

From the article:

In the fourth part of the tutorial, I introduced the theoretical ideas behind the return types of the three way operator in C++20 and demonstrated that there might be semantic restrictions on the program that allow for comparison of equivalence instead of equality. Also I demonstrated by a simple example when can two objects be semantically incomparable, even though the syntax of program allows to compare them and how to deal with such cases with the help of operator<=>...

On the perils of holding a lock across a coroutine suspension point--Raymond Chen

The series continue

On the perils of holding a lock across a coroutine suspension point, part 2: Nonrecursive mutexes

On the perils of holding a lock across a coroutine suspension point, part 3: Solutions

by Raymond Chen

From the article:

Last time, we looked at what can go wrong if you hold a recursive mutex across a coroutine suspension point. Do things get any better if you switch to a nonrecursive mutex?

CppCon 2019 Small is beautiful: Techniques to minimise memory footprint--Steven Pigeon

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Small is beautiful: Techniques to minimise memory footprint

by Steven Pigeon

Summary of the talk:

When we code, we often assume that the computer has an infinite amount of memory. This is, of course, /very/ false. It is false for embedded programming, where memory is often limited to a few megabytes or even a few kilobytes, but it is also false for the most powerful workstations and servers. Using memory wisely makes your application possible on small systems as well as prevents, or at least reduces, scaling problems for larger applications. While some programming languages are designed to hide implementation details from the programmer, C++ allows the programmer to specify, with a good level of control, how memory is allocated, structured, and used. In this talk, we will explore what can be done at run-time with negligible cost, what can be done at compile-time with meta-programming, and how we can thwart default compiler behavior to achieve memory-efficient type-safe data representations. We will also extend the discussion to the higher-level reorganization of data structures in order to make a better use of memory.

On the perils of holding a lock across a coroutine suspension point, part 1--Raymond Chen

More about coroutines.

On the perils of holding a lock across a coroutine suspension point, part 1: The set-up

by Raymond Chen

From the article:

Say you want to perform a bunch of asynchronous operations involving some object state, but also want to make sure that no other tasks access that object state at the same time. For synchronous code, you would use a traditional synchronization object like a mutex or critical section...

CppCon 2020 Get Off My Thread: Techniques for Moving Work to Background Threads--Anthony Williams

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Get Off My Thread: Techniques for Moving Work to Background Threads

by Anthony Williams

Summary of the talk:

If you're writing a GUI application and you want the interface to feel "responsive" to the user then you need the code that response to UI events to be short and fast. Similarly, if you are handling network I/O you may not want the processing of one request to prevent the system receiving further input.

If the work to be done in response to an event is complex and time consuming then you can maintain the "responsiveness" of the system by passing the work off to a background thread.

This talk will look at the ways of doing this, including managing ongoing work, providing progress updates, and cancelling work if it is no longer needed.