By: Gabriele Svelto (gabriele.svelto.delete@this.gmail.com), December 4, 2014 2:49 pm
Room: Moderated Discussions
Konrad Schwarz (no.spam.delete@this.no.spam) on December 4, 2014 1:10 pm wrote:
> The code base / programmer mindset that relies on atomic operations stems from
> a time/from operating systems where such light weight were not available.
Not for all use cases. Thread-safe reference counting - something very common in C++ - would be a couple of order of magnitudes slower using locks rather than atomic operations across pretty much any architecture I know of. That's not something that comes from a time where locks weren't available; it's a rather modern use case in fact.
> The code base / programmer mindset that relies on atomic operations stems from
> a time/from operating systems where such light weight were not available.
Not for all use cases. Thread-safe reference counting - something very common in C++ - would be a couple of order of magnitudes slower using locks rather than atomic operations across pretty much any architecture I know of. That's not something that comes from a time where locks weren't available; it's a rather modern use case in fact.