Handles are the better pointers (2018)
28-Nov-2018: I’ve added a small update at the end on how to prevent‘handle collisions’ with a per-slot generation counter
Posts that commenters keep linking to, ranked by how many different people have cited them in Hacker News comments. 44 posts.
28-Nov-2018: I’ve added a small update at the end on how to prevent‘handle collisions’ with a per-slot generation counter
I’m often surprised that people continually have fundamental misconceptions about how distributed systems behave. I myself shared many of these misconceptions, so I try not to demean or dismiss but rather educate and enlighten, hopefully while sounding less preachy than that just did. I continue to learn only by…
Many programming "best practices" taught today are performance disasters waiting to happen.
This article explains how to correctly handle filenames in Bourne shells (the primary shell of Unix/Linux/POSIX systems), based on the issues discussed in 'Fixing Unix/Linux/Filenames'. Many programs fail to work properly on filenames that include spaces, begin with dash (-), include newlines, and so on, because…
Three distinct perspectives on scale that come along with building and operating a storage system the size of S3.
How a mistake of less than half a millimeter in a single part nearly brought down the world’s largest passenger aircraft.
Well, that was unexpected. I recorded a couple of crappy videos in 5 minutes, posted them on a Twitter thread, and went viral with 8.8K likes at this point. I really could not have predicted that, given that I’ve been posting what-I-believe-is interesting content for years and… nothing, almost-zero interest. Now that…
The original ANSI C standard, C89, introduced the concept of “undefined behavior,” which was used both to describe the effect of outright bugs like accessing memory in a freed object and also to capture the fact that existing implementations differed about handling certain aspects of the language, including use of…
I ended up getting a response from high level people at AMD. It was still very light on any real technical information, but it did include some great phrases like “I am able to replicate the issues you are facing” and some mockable phrases like “We are hoping that this will improve your perception of AMD products and…
Since this article contains a lot of interactive demos relying on fairly modern browser technology, let's make sure that everything is OK before continuing.
If you remove the first word from the string "hello world" , what should the result be? This is the story of how we discovered that the answer could be your root password!
The teeth are not the only problem
Over the past year I’ve refined my approach to arena allocation . With practice, it’s effective, simple, and fast; typically as easy to use as garbage collection but without the costs. Depending on need, an allocator can weigh just 7–25 lines of code — perfect when lacking a runtime . With the core details of my own…
This post assumes some basic C skills. Linux puts you in full control. This is not always seen from everyone’s perspective, but a power user loves to be in control. I’m going to show yo…
This is the story of a clever trick that's been around for at least 35 years, in which array values can be left uninitialized and then read during normal operations, yet the code behaves correctly no matter what garbage is sitting in the array. Like the best programming tricks, this one is the right tool for the job…
Most people think assembly is only to be used to write toy programs for learning purposes, or to write a highly optimized version of a specific function inside a codebase written in a high-level language.
Xe Iaso's personal website.
We have a CPU mystery! We found a way to cause some processors to enter a glitch state where the normal rules don’t apply, but what does that mean…?
This is an introduction to data structure flattening, a special case of arena allocation that is a good fit for programming language implementations. We build a simple interpreter twice, the normal way and the flat way, and show that some fairly mechanical code changes can give you a 2.4× speedup.
This paper reflects work done in late 2022 and 2023 to audit for vulnerabilities in terminal emulators, with a focus on open source software. The results of this work were 10 CVEs against terminal emulators that could result in Remote Code Execution (RCE), in addition various other bugs and hardening opportunities…
You can't safely use the C setenv() or unsetenv() functions in a program that uses threads. Those functions modify global state, and can cause other threads calling getenv() to crash. This also causes crashes in other languages that use those C standard library functions, such as Go's os.Setenv ( Go issue ) and Rust's…
Nano How-To explaining how to setup a root file system with only emacs.
Developers often believe that software performance follows a Pareto distribution: 80% of the running time is spent in 20% of the code. Using this model, you can write most of your code without any care for performance and focus on the narrow pieces of code that are performance sensitive. Engineers like Casey Muratori…
In this article I will take a look at the classic concurrent ring buffer and how it can be optimized to increase throughput.
A bottom-up, animated guide to HTTP load balancing algorithms.
Note: If you're here because you just want to watch Netflix on Asahi, install this (Edit: for Arch users, grab this . Fedora users can install the widevine-installer package), and then scroll down to the "Netflix-Specific Annoyances" section.