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 · #10930

S

Snf's blog

Personal blog · snf.github.ioprogrammingsystems

Snf's blog is a personal blog at snf.github.io about programming and systems. Since 2019, 7 different Hacker News readers have linked it 8 times, most often “Shared_ptr<T>: the (not always) atomic reference counted smart pointer (2019)”. The last post was in 2019, but the archive is still widely read.

Visit the blog
8mentions?
7HN people?
2019–2025first – last linked?
Links on Hacker News per year · peak 4 in 2019

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

Why HN links it

HN commenters link this blog's 2019 post on shared_ptr optimization, which covers how libstdc++ skips atomic operations based on whether libpthread is linked. It is cited as a reference in C++ and C discussions.

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

Most-linked posts?

  1. Shared_ptr<T>: the (not always) atomic reference counted smart pointer (2019)
    5 people · 5 mentions · first linked 2019-08-14

What Hacker News says?

  1. True, but that's a fault of the implementation, which assumes POSIX is the only thing in town & makes questionable optimization choices, rather that of the language itself (for reference, the person above is referring to what's described here: https://snf.github.io/2019/02/13/shared-ptr-optimization/ )

    Comment linking /2019/02/13/shared-ptr-optimization/

    on “Giving C a superpower: custom header file (safe_c.h)”
  2. Submitted Shared_ptr<T>: the (not always) atomic reference counted smart pointer (2019) as a story · 51 points

    HN discussion
  3. The code you linked is a compile-time configuration option, which doesn't quite match "infer" IMO. I think GP is thinking of the way that libstdc++ basically relies on the linker to tell it whether libpthread is linked in and skips atomic operations if it isn't [0]. [0]: https://snf.github.io/2019/02/13/shared-ptr-optimization/

    Comment linking /2019/02/13/shared-ptr-optimization/

    on “A safe, non-owning C++ pointer class”
  4. Submitted C++'s shared_ptr: the (not always) atomic reference counted smart pointer as a story · 4 points

    HN discussion
  5. Submitted Shared_ptr<T>: the (not always) atomic reference counted smart pointer (2019) as a story · 3 points

    HN discussion
  6. Submitted Shared_ptr: The (not always) atomic reference counted smart pointer as a story · 3 points

    HN discussion
  7. Submitted shared_ptr&lt;T&gt;: the (not always) atomic reference counted smart pointer as a story · 3 points

    HN discussion
  8. Submitted Rust 2019: security as a story · 3 points

    HN discussion

Search all of HN for snf.github.io