Browsed by
Month: August 2018

Adding recursion to a read/write lock

Adding recursion to a read/write lock

Disclaimer: Years of working with custom locks, lock free, and memory consistency models has taught me that low level multi-threading is hard. I make no claims that the code below is safe or the right way to solve the problem. Use these techniques at your own risk. So far this code has passed all of my functional tests and is in active use in my codebase dealing with large databases. But… if I do find a flaw in this code…

Read More Read More

Memory Corruption

Memory Corruption

Today I had a memory overwrite in my code. It can happen to the best of us. I’ve known memory corruptions to take weeks to track down, they are the worst sort of bugs, which can go undetected for a long time and cause all sorts of strange knock on problems. This one took me 5 minutes to find and fix. It’s all about having the right tools. The corruption was caused by some code writing to a deleted pointer,…

Read More Read More