Liste des Groupes | Revenir à cl c++ |
Am 15.09.2024 um 20:54 schrieb Paavo Helde:[...]
Caching single numeric values is easy. However, some cached data is large and accessed via a std::shared_ptr type refcounted smartpointers. Updating such a smartpointer in a thread-shared object is a bit more tricky. There is a std::atomic<std::shared_ptr> in C++20, but I wonder if I can do a bit better by providing my own implementation which uses CAS on a single pointer (instead of DCAS with additional data fieldsI think that's impossible because copying that pointer needs split
or other trickery).
reference counting.
Les messages affichés proviennent d'usenet.