Articles & Books

I/O Prioritization in Windows OS -- Milad Kahsari Alhadi

In this paper, I am going to discuss how can we as the application or device driver developers take advantage of I/O prioritization in the Windows OS.

I/O Prioritization in Windows OS

by Milad Kahsari Alhadi

From the article:

I/O prioritization improves the responsiveness of the system without significantly decreasing the throughput of the system. Typically, any topic related to I/O and threads requires a good understanding of Windows synchronization because of that, I will try to discuss everything from the ground up.


In this paper, I am going to discuss how can we as the application or device driver developers take advantage of I/O prioritization in the Windows OS. Finally (in the next paper, I will discuss the I/O completion mechanism of Windows) which is a magical feature.

The Royal Game -- Philipp Lenk

This time around, I shall tell you about the royal game, i.e. chess, or rather of my humble attempts at contributing to its rich ecosystem of non-human players.

The Royal Game

by Philipp Lenk

From the article

I will begin by explaining what I am talking about, briefly recap the fascinating history of computer chess and in the course of that highlight the importance of game playing for showcasing, popularizing and driving machine intelligence research as well as its public perception. I shall further elaborate on my personal connection and love for the game and detail why - even in the face of a recent uptake of machine learning based techniques far more successful than my puny attempts could ever hope to be - an old-school, classical approach can still be a valuable investment of time and energy.
Afterwards [...] I will get just a little more technical and provide a high level explanation of the general structure underlying many chess playing programs, culminating in a walkthrough of code implementing the UCI protocol used to communicate with GUIs and other programs pitting different human and non-human connoisseurs of the game against one another.

Create a new type when using std::variant -- Zhihao Yuan

Enough typedefs.

Create a new type when using std::variant

by Zhihao Yuan

From the article:

class rock {};
class paper {};
class scissors {};
using hand = std::variant<rock, paper, scissors>;

Ignoring the fact that this hand type comes with heavily overloaded constructors and you can only add free functions, a troublesome issue is that the type-name std::variant<rock, paper, scissors> will appear everywhere in debuggers and linkers in place of hand.

Conditionally Trivial Special Member Functions--Sy Brand

c++ magic.

Conditionally Trivial Special Member Functions

by Sy Brand

From the article:

The C++ standards committee is currently focusing on adding features to the language which can simplify code. One small example of this in C++20 is conditionally trivial special member functions, which we added support for in Visual Studio 2019 version 16.8. Its benefit isn’t immediately obvious unless you’ve been deep down the rabbit hole of high-performance library authoring, so I’ve written this post to show you how it can make certain generic types more efficient without requiring huge amounts of template magic...

How to Share Code with Const and Non-Const Functions in C++--Bartlomiej Filipek

How do you do it?

How to Share Code with Const and Non-Const Functions in C++

by Bartlomiej Filipek

From the article:

During the development of a container-like type, I run into the problem of how to share code between a const and non-const member functions. In this article, I’d like to explain what are the issues and possible solutions. We can even go on a bleeding edge and apply some C++20 features. Which technique is most friendly?

Overload 159 is now available

ACCU’s Overload journal of October 2020 is out. It contains the following C++ related articles.

Overload 159 is now available

From the journal:

Virtual/Reality
By Frances Buontempo
Do we know what reality is? Frances Buontempo is no longer sure and now wonders if she’s a fictional character.

poly::vector – A Vector for Polymorphic Objects
By Ferenc Nándor Janky
Heterogeneous vectors can be slow. Janky Ferenc introduces a sequential container for storing polymorphic objects in C++.

Kafka Acks Explained
By Slanislav Kozlovski
Kafka’s configuration can be confusing. Slanislav Kozlovski helps us visualise this most misunderstood configuration setting.

Concurrency Design Patterns
By Lucian Tadu Teodorescu
Orchestrating concurrent tasks using mutexes is seldom efficient. Lucian Tadu Teodorescu investigates design patterns that help unlock concurrent performance.

C++ Modules: A Brief Tour
By Nathan Sidwell
C++20’s long awaited module system has arrived. Nathan Sidwell presents a tourist’s guide.

The Edge of C++
By Ferenc Deák
Everything has limits. Deák Ferenc explores the bounds of various C++ constructs.

Afterwood
By Chris Oldwood
Assume failure by default. Chris Oldwood considers various fail cases.

Quick Q: Why do I have to access template base class members through the this pointer?

Quick: in order to make x a dependent name, so that lookup is deferred until the template parameter is known

Recently on SO:

Why do I have to access template base class members through the this pointer?

If the classes below were not templates I could simply have x in the derived class. However, with the code below, I have to use this->x. Why?

template <typename T>
class base {

protected:
    int x;
};

template <typename T>
class derived : public base<T> {

public:
    int f() { return this->x; }
};

int main() {
    derived<int> d;
    d.f();
    return 0;
}