Articles & Books

Concurrency Flavours -- Lucian Radu Teodorescu

logo.pngConcurrency has many different approaches. Lucian Radu Teodorescu clarifies terms, showing how different approaches solve different problems.

Concurrency Flavours

by Lucian Radu Teodorescu

From the article:

Most engineers today use concurrency – often without a clear understanding of what it is, why it’s needed, or which flavour they’re dealing with. The vocabulary around concurrency is rich but muddled. Terms like parallelism, multithreading, asynchrony, reactive programming, and structured concurrency are regularly conflated – even in technical discussions.

This confusion isn’t just semantic – it leads to real-world consequences. If the goal behind using concurrency is unclear, the result is often poor concurrency – brittle code, wasted resources, or systems that are needlessly hard to reason about. Choosing the right concurrency strategy requires more than knowing a framework or following a pattern – it requires understanding what kind of complexity you’re introducing, and why.

To help clarify this complexity, the article aims to map out some of the main flavours of concurrency. Rather than defining terms rigidly, we’ll explore the motivations behind them – and the distinct mindsets they evoke. While this article includes a few C++ code examples (using features to be added in C++26), its focus is conceptual – distinguishing between the flavours of concurrency. Our goal is to refine the reader’s taste for concurrency.

Finding the Next Code Point in Unicode Strings -- Giovanni Dicanio

With ASCII, it's very simple to find the next character in a string: you can just increment an index (i++) or char pointer (pch++). But what happens when you have Unicode strings to process?

Finding the Next Unicode Code Point in Strings: UTF-8 vs. UTF-16

by Giovanni Dicanio

From the article:

Both UTF-16 and UTF-8 are variable-length encodings. In particular, UTF-8 encodes each valid Unicode code point using one to four 8-bit byte units. On the other hand, UTF-16 is somewhat simpler: In fact, Unicode code points are encoded in UTF-16 using just one or two 16-bit code units.

(...) The functions have the following prototypes:

// Returns the next Unicode code point and number of bytes consumed.
// Throws std::out_of_range if index is out of bounds or string ends prematurely.
// Throws std::invalid_argument on invalid UTF-8 sequence.
[[nodiscard]] std::pair<char32_t, size_t> NextCodePointUtf8(
    const std::string& str,
    size_t index
);

// Returns the next Unicode code point and the number of UTF-16 code units consumed.
// Throws std::out_of_range if index is out of bounds or string ends prematurely.
// Throws std::invalid_argument on invalid UTF-16 sequence.
[[nodiscard]] std::pair<char32_t, size_t> NextCodePointUtf16(
    const std::wstring& input,
    size_t index
);

 

Hardening the C++ Standard Library at massive scale -- Dionne, Rebert, Shavrick, and Varlamov

acmqueue_logo.gifMemory-safety vulnerabilities remain one of the most persistent and costly risks in large-scale C++ systems, even in well-tested production code. This article explores how hardening the C++ Standard Library—specifically LLVM’s libc++—can deliver meaningful security and reliability gains at massive scale with minimal performance overhead.

Practical Security in Production: Hardening the C++ Standard Library at massive scale

by Louis Dionne, Alex Rebert, Max Shavrick, and Konstantin Varlamov

From the article:

Over the past few years there has been a lot of talk about memory-safety vulnerabilities, and rightly so—attackers continue to take advantage of them to achieve their objectives. Aside from security, memory unsafety can be the cause of reliability issues and is notoriously expensive to debug. Considering the billions of lines of C++ code in production today, we need to do what we can to make C++ measurably safer over the next few years with as low of an adoption barrier as possible.

In 2019, Alex Gaynor, a security expert and one of the leading voices in memory safety, wrote a piece titled "Modern C++ Won't Save Us," where he gave examples of foundational types such as std::optional that were unsafe in the idiomatic use cases. What happens when these unsafe types are used beyond their contract? Well, you guessed it: undefined behavior. The std::optional type isn't the only one to behave like this. If you look at how this compares with modern languages, you can see that C++ is the outlier.

So, what's to be done? Possibly one of the best places to start today is by improving our standard libraries. They provide the baseline "vocabulary types" for developers—and if they're not safe, it will be tough to build safety around them. The std::optional type is only one of many vocabulary types in the C++ Standard Library that aren't safe by default today. Given the current state, it seems mostly clear that the first step should be hardening our standard library, and in our case, this was LLVM's libc++.

Qt acquires I.A.R.

Qt completes the recommended public cash offer to the shareholders of I.A.R. Systems Group

From the article:

On 4 July 2025, Qt Group Plc's ("Qt Group") wholly owned subsidiary The Qt Company Ltd ("The Qt Company" and together with Qt Group, "Qt"), announced a recommended public cash offer to the shareholders of class B shares (the "Shares" or, individually, a "Share") in I.A.R. Systems Group AB (publ) ("IAR"), to tender all their Shares at a price of SEK 180 in cash per Share (the "Offer"). The Shares in IAR are traded on Nasdaq Stockholm, Mid Cap. An offer document relating to the Offer was published on 15 August 2025.

At the end of the acceptance period on 10 October 2025, the Offer had been accepted by shareholders with a total of 12,037,848 Shares in IAR, corresponding to 94.49 per cent of the outstanding shares and votes in IAR.[1] As a result, The Qt Company controls in total 12,037,848 Shares in IAR, corresponding to 94.49 per cent of the outstanding shares and votes in IAR.[2]

The Qt Company has decided to complete the Offer. All conditions are satisfied or have been waived. Settlement for Shares tendered in the Offer during the initial acceptance period will be initiated on or around 17 October 2025.

 

Event-driven flows -- Andrzej Krzemieński

2025-12-19_10-06-35.pngThis post is in response to two claims about coroutines: 1) Their reference function parameters may become dangling too easily, and 2) They are indistinguishable from regular functions from the declaration alone.

Event-driven flows

by Andrzej Krzemieński

From the article:

A canonical example of an event-driven flow is the handling of signals in C. Signals will be risen at unpredictable points in time, so rather than actively checking for them, we define a callback and associate it with the indicated signal:

signal(SIGINT, on_interrupt);

 

After having performed this association, we move on to doing other things. It is the implementation (system, or parts of the program we do not write) that will make sure to invoke the callback when the signal is risen (if at all). We can illustrate it with a diagram:

 

Converting Between Unicode UTF-16 and UTF-8 in Windows C++ Code -- Giovanni Dicanio

Very often the need arises in Windows C++ programming to convert text between Unicode UTF-16 (which historically has been the native Unicode encoding used by Windows APIs) and UTF-8 (which is the de facto standard for sending text across the Internet and exchanging text between different platforms).

Converting Between Unicode UTF-16 and UTF-8 in Windows C++ Code

by Giovanni Dicanio

From the article:

A detailed discussion on how to convert C++ strings between Unicode UTF-16 and UTF-8 in C++ code using Windows APIs like WideCharToMultiByte, and STL strings and string views.

 

C++ Standard Evolution Viewer -- Jason Turner

EDepositphotos_193487310_L.jpgxplore how the C++ standard evolved across versions with interactive side-by-side diffs

C++ Standard Evolution Viewer

by Jason Turner

From the article:

This site provides an interactive way to explore changes in the C++ standard by viewing side-by-side diffs of individual sections (identified by stable names like [array][class.copy][ranges.adaptors]).

Each version transition below focuses on Tier 1 sections (major library components and language features) to provide the most educational value.

Structured iteration -- Andrzej Krzemieński

It is relatively easy to get your for-loops wrong. Luckily, C++ offers more and more bug-proof alternatives.

Structured iteration

by Andrzej Krzemieński

From the article:

These problems do not occur when you use the range-based for-loop.

This C++11 addition, apart from other conveniences, is a safety feature (as in language-safety): it is very hard to use it incorrectly. It is not flexible, or versatile. You have to pass it a range, you have to give a name to an element referenced in each iteration step. There is no "control variable" (like i), so you cannot get the operations on it wrong. A number of bugs are prevented simply by employing a range-based loop.

But what if my iteration is more complicated? What if I need to visit my elements in reverse?

 

Trip report: Meeting C++ 2025 -- Sandor Dargo

cippi-me-meeting-cpp2025.JPGWhat a year I had! One more conference, one more trip report! I had the chance to go to Meeting C++ and give not just one but two talks!

Trip report: Meeting C++ 2025

by Sandor Dargo

From the article:

I remember that last year I said that Berlin in November is the perfect place to have a conference because you want to be inside that four-star hotel and not outside. This year, the conference was held a week earlier, and the weather was so nice that it was actually tempting to go out and explore.

But people resisted the temptation. The lineup and content were very strong — this year there were more than 50 talks across 5 different tracks. Also, Meeting C++ is a fully hybrid conference, so you can join any talk online as well.

It might sound funny, but I must mention that the food is just great at Meeting C++. It’s probably the conference with the best catering I’ve ever been to — from lunch to coffee breaks, everything was top-notch.

This year, there were no evening programs. I’m not complaining; it’s both a pity and a blessing, and I’m not sure how I feel about it. For example, when I first attended C++ On Sea, there were no evening events, and I really enjoyed discovering Folkestone in the evenings. Over the years, the schedule there got extended, and sometimes I had no time to visit my favorite places. But at least some socializing was guaranteed. One can say that you can do it on your own, but many of us are introverted, and if we’re not forced to socialize, we just won’t. That’s even easier to avoid in a big city like Berlin. I remember that last year I didn’t have time to go out until the end of the conference. It was different this year.

But let’s talk about the talks.

My three favourite talks

Let me share with you the three talks I liked the most. They are listed in chronological order...

 

C++ Enum Class and Error Codes -- Mathieu Ropert

Me.jpgC++11 gave us enum class and while it’s great to have scoped enums I don’t find it great for error handling. Let’s talk about why.

C++ Enum Class and Error Codes

by Mathieu Ropert

From the article:

Most of my readers, I hope, have been able to use C++11 for a while now (if not hello, I’m sorry the world has changed to become this weird during your 14 years sleep). With it came a small change that allowed for better scoping of names without resorting to weird quirks: enum class. The idea is simple: owing to C, enum values in C++ belong to the class or namespace they are declared in but if we add the class keyword to the declaration they know become their own scope instead of leaking to their parent.

This was a simple quality of life change in the compiler to address a weakness in the language that folks usually worked around by either adding long prefix to the enum values (C style) or wrapping them within structs or classes (C++98/03 style). And with it came the incentive to migrate C era error code enums to scoped enums. But there’s a catch.