| Deutsch English Français Italiano |
|
<vc7f99$2atht$6@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> Newsgroups: comp.lang.c++ Subject: Re: Atomic caching of smart pointers Date: Sun, 15 Sep 2024 13:15:37 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: <vc7f99$2atht$6@dont-email.me> References: <vc7ahq$2akr4$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 15 Sep 2024 22:15:38 +0200 (CEST) Injection-Info: dont-email.me; posting-host="78a7b50be27a8595bbf19a3d12d98608"; logging-data="2455101"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+H6xzIl7qCcxQMOK6rTZQgYjwnOxFoPYI=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:8zXpoUZU9SbE5AdeD05cKnlp+f0= Content-Language: en-US In-Reply-To: <vc7ahq$2akr4$1@dont-email.me> Bytes: 1491 On 9/15/2024 11:54 AM, Paavo Helde wrote: [...] > So, what do you think? Should I just use std::atomic<std::shared_ptr> > instead? Any other suggestions? Did I get the memory order parameters > right in compare_exchange_weak()? Keep in mind that you need to make sure that std::atomic<std::shared_ptr> is actually lock-free... Make sure to investigate is_always_lock_free on your various arch's: https://en.cppreference.com/w/cpp/atomic/atomic/is_always_lock_free