Top all-time · #10930
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.
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?
- 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?
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)”Submitted Shared_ptr<T>: the (not always) atomic reference counted smart pointer (2019) as a story · 51 points
HN discussionThe 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”Submitted C++'s shared_ptr: the (not always) atomic reference counted smart pointer as a story · 4 points
HN discussionSubmitted Shared_ptr<T>: the (not always) atomic reference counted smart pointer (2019) as a story · 3 points
HN discussionSubmitted Shared_ptr: The (not always) atomic reference counted smart pointer as a story · 3 points
HN discussionSubmitted shared_ptr<T>: the (not always) atomic reference counted smart pointer as a story · 3 points
HN discussionSubmitted Rust 2019: security as a story · 3 points
HN discussion