Category: Uncategorized

  • Should Unicode literals be guaranteed to be well-formed?

    TL;DR Betteridge’s law applies: No. Are you still here? Unicode Literals In C++ 20 there are 2 kinds and 6 forms of Unicode literals. Character literals and string literals, in UTF-8, UTF-16, and UTF-32 encodings. Each of them uses a distinct char type to signal in the type system what the encoding is for the…

  • Litmus Tests for Multithreaded Behavior

    Litmus Tests for Multithreaded Behavior Or How Processors Don’t Do What You Think Modern multicore processors are entirely weirder than almost anyone thinks possible. They are somewhat weirder than chip makers were willing to admit until fairly recently. They are sufficiently weird enough that almost all multi-threaded programs, and many lock-free algorithms, had bugs because…

  • Multithread Experiments

    An Experiment Collects Samples I’m modelling this in order to run bits of code like the various litmus tests used to describe multi-core architectures. A set of functions to be run in parallel that may or may not write to a result, which type is a property of the Test being run. The Experiment will…

  • Why std::bind can’t be (formally) deprecated

    Yes: std::bind should be replaced by lambda For almost all cases, std::bind should be replaced by a lambda expression. It’s idiomatic, and results in better code. There is almost no reason post C++11 to use std::bind. Doing so is quite straightforward, capture each bind argument by value in the lambda capture list, and provide auto…

  • Accessing the elements of a tuple as variant

    A further digression, because it turns out I want to be able to permute a tuple at run time. That means treating the element of a tuple generically. And I can just barely do this, for some tuples, in c++17. So a slight digression into ADTs. Which in this case means Algebraic Data Types, not…

  • Cross Compiling

    Table of Contents 1. Setting up Cross Compiling 2. Sysroot 3. Static linking 4. CMake 5. Sources 1 Setting up Cross Compiling In order to test out some of these multi-threaded tool properly, I really need to run them on a less strict platform than x86_64. X86_64 provides a lot of guarantees about sequential consistency…

  • batch: running functions under a spingate

    1 A batch of tasks to run This adds a rather simple component to spingate orchestrating a batch of tasks to be run, gated by the spingate. The tasks are added one at a time, a thread is created for the task, and the thread waits on the spingate to open before calling the task.…

  • spingate

    1 Building a simple spin gate in C++ This is a very simplified latch which allows several threads to block and busywait until they are released to begin work in parallel. I’m using this to do some multi-thread stress testing, where I want to maximize the overlapping work in order to check for suprising non-deterministic…

  • Building Emacs 25.1 on Ubuntu 16.10

    Table of Contents 1. Why notes 2. Getting Ready 3. Configure and build with magic option 1 Why notes Making notes so I don’t forget, although the key problem is fixed upstream. Ubuntu 16.10 (Yakkety Yak) has made a critical change to the system compiler, and everything is by default built with position independent executable…

  • Protected: Video from OSR

    There is no excerpt because this is a protected post.