logoalt Hacker News

saurikyesterday at 2:08 PM2 repliesview on HN

I'd think a POSIX mutex--a standard API that I not only could implement anywhere, but which has already been implemented all over the place--is way more "cross platform" than use of atomics.


Replies

woodruffwyesterday at 2:32 PM

To lift things up a level: I think a language’s abstractions have failed if we even need to have a conversation around what “cross platform” really means :-)

show 2 replies
wat10000yesterday at 7:32 PM

If you're targeting a vaguely modern C standard, atomics win by being part of the language. C11 has atomics and it's straightforward to use them to implement thread-safe reference counting.