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 will discuss the further optimizations to reduce the number of operations on shared state, thus eliminating the need for memory barriers completely in many cases.
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 locality. As I found the first one to be more interesting, and the refinements more useful for general multi-threaded programming, I thought I’d explain that one in a bit more detail.
Continue reading

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

Progress in DNP3 security

In July last year, I discussed why Adam Crain and Chris Sistrunk fuzzed DNP3 stacks in devices from various vendors, finding many issues along the way (see project Robus). This time, I’ll provide a bit of an overview of what has happened since.
Continue reading

Posted in DNP3, Smart Grid | Comments Off on Progress in DNP3 security

CIS: “Protecting” code in stead of data

The Windows API contains a synchronization primitive that is a mutual exclusion device, but is also a colossal misnomer. I mean, of course, the CRITICAL_SECTION.

Continue reading

Posted in Common Issues with Synchronization | Tagged , | Comments Off on CIS: “Protecting” code in stead of data

CIS: Lock Leaks

The two most popular threading APIs, the Windows API and pthreads, both have the same basic way of locking and unlocking a mutex — that is, with two separate functions. This leaves the code prone to lock leak: the thread that acquired a lock doesn’t release it because an error occurred.

Continue reading

Posted in Common Issues with Synchronization | Tagged | Comments Off on CIS: Lock Leaks

CIS: Unexpected Coupling

One of the most common problems with synchronization occurs when things need each other that you didn’t expect to need each other.
Continue reading

Posted in Common Issues with Synchronization | Comments Off on CIS: Unexpected Coupling

Git demystification

There are a few misconceptions I hear about Git that I find should be cleared up a bit, so here goes:
Continue reading

Posted in Opinions | Tagged | Comments Off on Git demystification

Three ideas you should steal from Continuous Integration

I like Continuous Integration — a lot. Small incremental changes, continuous testing, continuous builds: these are Good Things. They provide statistics, things you can measure your progress with. But Continuous Integration requires an investment on the part of the development team, the testers, etc. There are, however, a few things you can adopt right now so, I decided to give you a list of things I think you should adopt.
Continue reading

Posted in Quality, Software Development, Software Engineering, Software Testing | Tagged | Comments Off on Three ideas you should steal from Continuous Integration

Eliminating waste as a way to optimize

I recently had a chance to work on an implementation of an Arachnida-based web server that had started using a lot of memory as new features were being added.

Arachnida itself is pretty lean and comes with a number of tools to help build web services in industrial devices, but it is not an “app in a box”: some assembly is required and you have to make some of the parts yourself.
Continue reading

Posted in Anecdotes, Software Design | Tagged , , , | Comments Off on Eliminating waste as a way to optimize

Technical documentation

Developers tend to have a very low opinion of technical documentation: it is often wrong, partial, unclear and not worth the trouble of reading. This is, in part, a self-fulfilling prophecy: such low opinions of technical documentation results in them not being read, and not being invested in.
Continue reading

Posted in Opinions, Quality, Software Engineering | Tagged | Comments Off on Technical documentation