Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-11358

QAtomicInt need more methods

XMLWordPrintable

      Today i try write variant function std::call_once on Qt, but i can't write fast version because QAtomicInt doesn't have FAST atomic methods like:

      std::atomic<T>::load(std::memory_order_relaxed);
      std::atomic<T>::load(std::memory_order_consume);
      std::atomic<T>::load(std::memory_order_acquire);
      std::atomic<T>::load(std::memory_order_seq_cst);
      
      std::atomic<T>::store(value, std::memory_order_release);
      std::atomic<T>::store(value, std::memory_order_relaxed);
      std::atomic<T>::store(value, std::memory_order_seq_cst);
      

      Instead it i used FetchAndStoreAcquire (Load) and FetchAndStoreRelease (Store). My algorithm 15 sec on 1 billion operations, std::call_once - 9 sec.

      And why QAtomicInt doesn't have atomic operators like "operator=" and "operator int() const"?

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
            sabrog Vladislav
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes