Work in progress: 181,232 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #3293

E

Erik Rigtorp

Personal blog · rigtorp.se · on HN as rigtorpprogrammingsystems

Erik Rigtorp's personal blog at rigtorp.se covers programming and systems. Since 2020, 22 different Hacker News readers have linked it 34 times, most often “Optimizing a ring buffer for throughput (2021)”. The last post was in 2022, but the archive is still widely read.

Visit the blog
34mentions?
22HN people?
2020–2026first – last linked?
Links on Hacker News per year · peak 8 in 2020

Too few sampled comments (11) to say how often HN recommends it.?

Why HN links it

HN readers link Erik Rigtorp's blog for C++ and low-level concurrency posts on lock-free queues, core-to-core latency, atomics, hashing and compiler alignment behaviour.

Summarised by Claude from a sample of 11 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.

The author on HN?

rigtorp · 55 karma · member since 2014

https://rigtorp.se

From their public HN profile, which links to this site.

Most-linked posts?

  1. Optimizing a ring buffer for throughput (2021)
    9 people · 9 mentions · first linked 2022-05-15
  2. Latency Implications of Virtual Memory
    6 people · 9 mentions · first linked 2020-07-11
  3. Correctly implementing a spinlock in Modern C++
    4 people · 4 mentions · first linked 2020-04-26
  4. Low latency tuning guide
    3 people · 3 mentions · first linked 2020-08-02
  5. Aligned AVX loads and stores are atomic
    2 people · 2 mentions · first linked 2021-04-19
  6. /split-locks/
    2 people · 2 mentions · first linked 2020-06-10

What Hacker News says?

  1. Yes, I've done this using libFuzzer. Supply custom mutation and crossover functions that generates interesting floating point numbers. Then let the coverage guided fuzzer exercise your code. https://rigtorp.se/fuzzing-floating-point-code/

    Comment linking /fuzzing-floating-point-code/

    on “There are only four billion floats, so test them all (2014)”
  2. Submitted Low latency tuning guide as a story · 294 points

    HN discussion
  3. This benchmark reminds me of "ffwd: delegation is (much) faster than you think" https://www.seltzer.com/margo/teaching/CS508-generic/papers-... . This paper describes a mechanism for client threads pinned to a distinct cores to delegate a function call to distinguished server thread pinned to its own core all on the same socket. This has a multitude of applications the most obvious one making a shared data structure…

    Comment linking /ringbuffer/

    on “Measuring CPU core-to-core latency”
  4. Submitted Correctly implementing a spinlock in Modern C++ as a story · 115 points

    HN discussion
  5. virgulino · 2022-09-18Recommends
    I went to your homepage. Your gif "Programming in C++" made me really laugh, thanks for that! 8-) https://rigtorp.se/

    Comment linking /

    on “Measuring CPU core-to-core latency”
  6. Submitted Latency Implications of Virtual Memory as a story · 6 points

    HN discussion
  7. You might be interested in https://rigtorp.se/virtual-memory/ where I look deeper at the VM subsystem.

    Comment linking /virtual-memory/

    on “Low latency tuning guide”
  8. Submitted Aligned AVX loads and stores are atomic as a story · 3 points

    HN discussion
  9. I have another article on virtual memory: https://rigtorp.se/virtual-memory/

    Comment linking /virtual-memory/

    on “Low latency tuning guide”
  10. Submitted Latency Implications of Virtual Memory as a story · 3 points

    HN discussion
  11. You're incorrect, garbage collection would be the biggest problem for that use case. You have to be really careful even with your C/C++ code, warming up the branch predictor between packets etc, see my article for some pitfalls: https://rigtorp.se/virtual-memory/

    Comment linking /virtual-memory/

    on “Shenandoah in OpenJDK 17: Sub-millisecond GC pauses”
  12. Submitted Correctly Implementing a Spinlock in C++ as a story · 3 points

    HN discussion
  13. A GPU followup to this article. While on CPU sequentially consistent semantics are efficient to implement, that seems to be much less true on GPU. Thus, Vulkan completely eliminates sequential consistency and provides only acquire/release semantics[1]. It is extremely difficult to reason about programs using these advanced memory semantics. For example, there is a discussion about whether a spinlock implemented in t…

    Comment linking /spinlock/

    on “Programming Language Memory Models”
  14. Submitted Latency Implications of Virtual Memory as a story · 2 points

    HN discussion
  15. https://rigtorp.se/ringbuffer/ , from a comment below, answered my question. In rough terms, every push or pop from the queue also causes head or tail to be written, thus dirtying a line of cache. That’s the bit I misunderstood.

    Comment linking /ringbuffer/

    on “A lock-free, concurrent, generic queue in 32 bits”
  16. Submitted Optimizing a Ring Buffer for Throughput (2021) as a story · 2 points

    HN discussion
  17. This is cool but it seems like it occupies an unusual place in tradeoff space. Most of the time SPSC queues would benefit from having the start and end pointers in separate pages, or even having cached copies of the start and end pointers in even more separate pages to avoid atomics[0]. [0]: https://rigtorp.se/ringbuffer/

    Comment linking /ringbuffer/

    on “A lock-free, concurrent, generic queue in 32 bits”
  18. Submitted Optimizing a Ring Buffer for Throughput as a story · 2 points

    HN discussion
  19. Yeah, split locks have a huge performance impact, especially with high core counts: https://rigtorp.se/split-locks/ Fortunately the Linux kernel can kill offenders with SIGBUS: https://www.phoronix.com/scan.php?page=news_item&px=Linux-Sp...

    Comment linking /split-locks/

    on “How SGX Fails in Practice”
  20. Submitted Optimizing a ring buffer for throughput (2021) as a story · 2 points

    HN discussion
  21. I've written some on this topic. Start here https://rigtorp.se/virtual-memory/ , there is more on similar stuff on my website.

    Comment linking /virtual-memory/

    on “Immutability Changes Everything (2016)”
  22. Submitted Optimizing a Ring Buffer for Throughput as a story · 2 points

    HN discussion
  23. > the fundamental limit for atomic writes is usually the register-size for a CPU which is usually 64 or 32 bits CPUs nowadays support double the largest general-purpose register width. Unofficially, some CPUs can also do twice that: https://rigtorp.se/isatomic/

    Comment linking /isatomic/

    on “A surprising enum size optimization in the Rust compiler”
  24. Submitted Latency Implications of Virtual Memory as a story · 1 points

    HN discussion
  25. It's nonsense to do this when you can be preempted. But you can run one thread per core and avoid preemption. You can tune the linux kernel to avoid almost all preemption, due to TLB shootdowns etc: https://rigtorp.se/low-latency-guide/

    Comment linking /low-latency-guide/

    on “Correctly implementing a spinlock in Modern C++”
  26. Submitted Optimizing a Ring Buffer for Throughput as a story · 1 points

    HN discussion
  27. ajtulloch · 2021-11-16Recommends
    https://rigtorp.se/notes/hashing/ and links therein ( https://github.com/martinus/better-faster-stronger-mixer ) are almost certainly preferable to this mixer.

    Comment linking /notes/hashing/

    on “A hash function using only add, sub, ror, and xor”
  28. Submitted Tips for Using the Sockets API as a story · 1 points

    HN discussion
  29. bpftrace was instrumental in helping me diagnose a latency spike on a hot path. I call into a vendor library that eventually calls into Solarflare's TCPDirect API to send packets to the network. This call usually stays under 5us and has very little variance, but I was seeing the occasional 30ms or 60ms outlier. I attached probes to track the latency of each call down the stack and it became quite easy to pin down th…

    Comment linking /virtual-memory/

    on “Exploring a Language Runtime with Bpftrace”
  30. That looks like a rewrite of my earlier work: https://rigtorp.se/ringbuffer/

    Comment linking /ringbuffer/

    on “Girls Just Wanna Have Fast MPMC Queues with Bounded Waiting”

Search all of HN for rigtorp.se

Linked by the same people?