octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switch to std::atomic?


From: John W. Eaton
Subject: Re: Switch to std::atomic?
Date: Wed, 25 Sep 2019 10:34:41 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 9/13/19 5:29 PM, Rik wrote:

Would it make sense to switch to using std::atomic<octave_idx_type>?  In
that case, Octave would be portable to any machine with a valid C++ runtime
library, and we certainly require that.  The std::atomic class overloads
the (pre-, post-)(increment, decrement) operators so one could write more
readable code with count++ rather than OCTAVE_ATOMIC_POST_INCREMENT(count).

Yes, now that it is a standard C++ feature, we should be using that. For a simple transition, can we first define our refcount class using std::atomic<T>?

Would you like to make this change?  If not, I can look at it.

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]