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

Check whether a q20::atomic<shared_ptr> is feasible

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None

    Description

      *Do NOT look into existing stdlib implementations if you consider implementing this*

      The interface to access atomic operations has changed between C++11/14/17¹, Concurrency-TS² and C++20+³, and the old way was immediately deprecated in C++20 and is going to be removed in C++26.

      This suggests to write a q20::atomic that is specialized for shared_ptr to use the C++11 API and falls back to std::atomic for everything else. In C++20 mode, it is then an alias for std::atomic. You won't be able to implement the atomic wait and notify API of std20::atomic, but that's ok under the rules of the qNN namespace: the guarantee is only from the q20:: implementation to the std one, not vice versa.

      ¹ https://en.cppreference.com/w/cpp/memory/shared_ptr/atomic
      ² https://en.cppreference.com/w/cpp/experimental/atomic_shared_ptr
      ³ https://en.cppreference.com/w/cpp/memory/shared_ptr/atomic2

      Attachments

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

        Activity

          People

            cnn Qt Core & Network
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes