- I don't get it. If the ring structure has 4 field (excluding the cold ones), and all 4 have alignment constraints, doesn't it define 4 zones in 4 cache lines, and not 2?
I expected head and cached_tail, for example, to share the same line, but since they are both 128-byte aligned, they end up in separate lines. Granted, both lines are dedicated to only one side of the producer-consumer pipe, but we're wasting cache lines for nothing.
by kouteiheika
0 subcomment
- > the mechanics that make zoning real: why #[repr(C)] is load-bearing, why the magic number is often 128 and not 64, and why adding prefetch hints can make things worse.
> The honest rule
Sigh... yet another Claude written article, and (unless I'm blind) it doesn't seem to be disclosed anywhere.
Normally I'm not the one to complain, but it's really tedious to see this writing style pretty much everywhere nowadays, and the more you see it the more you start to find it unbearable to read.
by jauntywundrkind
0 subcomment
- Side note, nice seeing Debasish Ghosh working in Rust! Yay. As is tradition in Rust world, yes they have their own (rather extensive) repo of ring buffers. https://github.com/debasishg/ringmpsc-rs
- the best way to prevent false sharing is by making it so that no two threads are in a position to access the same data structure which may be inconsistent because it is being written to. embrace message passing.
- But I don't really get what the problem is with using AI for editing. This article clearly has a sense of what it's trying to say. A human wrote the first draft, and then AI polished it. It's a method I use a lot myself. So it's a human plus AI hybrid piece, and honestly, I don't see anything particularly wrong with the content.
Stuff like isolating the hot core and packing the cold fields, that's just common knowledge you pick up.
Compared to purely human writing, it's actually safer and reads better than you'd expect, so I find it hard to understand why people are complaining about this.
If anything, I think tech blogs especially need to check whether their own thoughts line up with the knowledge of an LLM, which is basically a talking encyclopedia. But it seems like people don't really see it that way.