Clicky

Blog Archives

Music box doorbell prototype

My apartment in Amsterdam has a very old and extremely loud doorbell. I decided to make a new one, because I was tired of being startled every time someone rang the doorbell. I had a music box sitting around, and

Posted in Programming

GOTO Still considered harmful…

I hate to break it to all the C/Linux hackers out there, but Dijkstra is right. Even though Linus says that goto is ok in error handling (as a poor mans exception handler basically) he is wrong. Now I will show why with

Posted in Programming

Yet another ATX bench top power supply

Everyone has hacked their ATX supply to provide a crude and cheap bench top supply. However at work I have a “real” bench top power supply, and it is really nice to be able to adjust the voltage with a

Posted in Programming

A use case for intrusive pointers

Why use intrusive pointers? In the docs for boost intrusive_ptr it states: The main reasons to use intrusive_ptr are: Some existing frameworks or OSes provide objects with embedded reference counts; The memory footprint of intrusive_ptr is the same as the corresponding raw pointer; intrusive_ptr<T> can

Posted in Programming

A simple thread safe queue for use in multi-threaded C++ applications

An efficient thread safe queue is one of the first things that should be implemented in any multithreaded application. The requirements for my thread safe queues are usually something like this: The thread safe queue shall provide the ability to

Posted in Programming

TCP Message Framing

TCP is a streaming protocol, it is most efficient at sending large amounts of “stream” type data, but the best thing about TCP is that it is reliable. If you send data over TCP, unless there is a catastrophic network

Posted in Programming

How to run threads

Frequently people struggle with simple things when writing multithreaded applications, here I will lay out some simple rules and provide a C++ pattern that can be followed to make multithreading a breeze. This will be focused on C++, but most

Posted in Programming