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…
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…
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…
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…
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…
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…
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…
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…