Hacker News new | ask | show | jobs
by alextingle 556 days ago
Well I learned that the default memory ordering in a std::atomic<> is memory_order_seq_cst. That really surprised me. I had previously imagined that if I'd wanted memory barriers in addition to atomicity, then I'd have to ask for them.

Seems like a strange default to me. Obviously it helps out people who aren't really aware of the problem, but then... surely those people won't think to use an atomic operations library in the first place?