How to stop Linux threads cleanly
Stopping a Linux thread is a surprisingly annoying affair. In this post I present common pitfalls and some solutions -- although no truly satisfactory method exists.
Visit mazzo.li → RSS feedOn Hacker News May 2021 – Oct 2025
Systems & Performance 6Software Engineering 4Math & Algorithms 3Society, Policy & Culture 1Security & Privacy 1Networking & Internet 1
Stopping a Linux thread is a surprisingly annoying affair. In this post I present common pitfalls and some solutions -- although no truly satisfactory method exists.
Addendum : Many Hacker News commenters correctly point out that the right way to indicate to the compiler that a value does not change is const . This post is not about C best practices, but just about how one can easily get to the bottom of this kind of surprising behavior by looking at the compiler output. This…
Let’s say we want to store some data on multiple drives, so that we can recover from drive failures.
When doing systems programming we often need to wait for something to happen. Common examples might be waiting for some data to come through a socket or waiting on a lock. We also often want to wait on any of several conditions to become true. A web server might be handling many sockets at once, waiting for any number…