Category Archives: C & C++

Interesting modifications to the Lamport queue, part II

In the previous installment, on this subject, I described a few modifications to the Lamport queue introduced by Nhat Minh Le et al. to relax operations on shared state as much as possible, while maintaining correctness. In this article, I … Continue reading

Posted in Algorithms, C & C++, Interesting stuff | Comments Off on Interesting modifications to the Lamport queue, part II

Interesting modifications to the Lamport queue

While researching lock-free queue algorithms, I came across a few articles that made some interesting modifications to the Lamport queue. One made it more efficient by exploiting C11’s new memory model, while another made it more efficient by using cache … Continue reading

Posted in Algorithms, C & C++, C++ for the self-taught, Interesting stuff | Comments Off on Interesting modifications to the Lamport queue

Radical Refactoring: Breaking Changes

One of the most common sources of bugs is ambiguity: some too-subtle API change that’s missed in a library update and introduces a subtle bug, that finally only gets found out in the field. My answer to that problem is … Continue reading

Posted in Anecdotes, C & C++, C++ for the self-taught, Embedded software development, Radical Refactoring | Comments Off on Radical Refactoring: Breaking Changes

Radical Refactoring: Have the compiler to (some of) the reviewing

One of the most common sources of bugs is ambiguity: some too-subtle API change that’s missed in a library update and introduces a subtle bug, that finally only gets found out in the field. My answer to that problem is … Continue reading

Posted in Anecdotes, C & C++, C++ for the self-taught, Embedded software development, Radical Refactoring | Comments Off on Radical Refactoring: Have the compiler to (some of) the reviewing

Optimization by puzzle

Given a query routine that takes a name and may return several, write a routine that takes a single name and returns a set of names for which each of the following is true: For each name in the set, … Continue reading

Posted in Algorithms, C & C++, C++ for the self-taught, Software Design, Software Development, Software Engineering | 1 Comment

Optimizing with type lists

In this post, I will take a brief look at how using type lists can help optimize certain applications.

Posted in C & C++ | Comments Off on Optimizing with type lists

A functional version of the KMP algorithm

For one of the projects I’m working on, I needed a compile-time version of the KMP algorithm in C++. I started by making the algorithm functional.

Posted in C & C++, Software Development | Comments Off on A functional version of the KMP algorithm

Run-time composed predicates and Code generation

While working on Arachnida, preparing version 2.2 due out this fall, one of the things we’ll be introducing is a hardened OpenSSL transport-layer-security plug-in, to replace the one we’ve had for the last seven or so years. One of the … Continue reading

Posted in C & C++, C++ for the self-taught, Software Design | Comments Off on Run-time composed predicates and Code generation

Sometimes, your right hand should know what your left hand is doing

Especially if you’re a compiler…

Posted in C & C++, Software Development | Comments Off on Sometimes, your right hand should know what your left hand is doing

Conditional in-place merge algorithm

Say you have a sorted sequence of objects. Go ahead, say: “I have a sorted sequence of objects!” Now say it’s fairly cheap to copy those objects, you need to be space-efficient and your sequence may have partial duplicates — … Continue reading

Posted in C & C++ | Tagged | Comments Off on Conditional in-place merge algorithm