[libcxx-commits] [libcxx] [libc++] P0718R2: Implementation of std::atomic<shared_ptr<T>> and std::atomic<weak_ptr<T>> (PR #194215)
Vladislav Semykin via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 4 02:16:35 PDT 2026
ViNN280801 wrote:
Big thanks to @jakeegan, I ran `run-buildbot aix` with `OBJECT_MODE=64`, here is the result:
<img width="993" height="895" alt="изображение" src="https://github.com/user-attachments/assets/75cc6755-9ccd-4717-977d-dfcd1c3d60cf" />
and ther is no `atomic_shared_ptr_stress.pass.cpp` test in the slowest tests list.
Here is the result on `OBJECT_MODE=32`:
<img width="1145" height="754" alt="изображение" src="https://github.com/user-attachments/assets/252c9429-81bc-435e-95f8-9f05d0722781" />
Command that I used for the run CI:
```bash
export OBJECT_MODE=64 && \
mkdir -p $HOME/mybins && \
ln -sf /opt/freeware/bin/python3 $HOME/mybins/python && \
cd llvm-project && \
PATH=$HOME/mybins:/opt/freeware/bin:$PATH \
CC=/opt/IBM/openxlC/17.1.4/compat/llvm/clang \
CXX=${CC}++ \
./libcxx/utils/ci/run-buildbot aix
```
> All the checks were performed on commit 3ef06a894b2926a55b24e763333362fd8d23bd86
Of course, I've done these experiments more than once, and indeed sometimes `atomic_shared_ptr_stress.pass.cpp` test fails. It is still unclear to me why this is happening.
I had an offer, but it was provided on an irrevocable basis - in the Claude Sonnet 4.6 browser (browser-based AI chat), but I would rather need more people who know this topic very deeply. The assumption sounds: "On POWER, 128-bit atomics use lqarx/stqcx. (LL/SC), not a true CAS like CMPXCHG16B. Under full suite load with 48 workers, reservation is constantly invalidated, causing the CAS loops in `__load_dwcas` to spin indefinitely - exponential contention. In 32-bit mode the pair fits in a 64-bit atomic, so a different instruction is used and it passes fine. A potential fix is adding backoff (e.g. [`sched_yield()`](https://man7.org/linux/man-pages/man2/sched_yield.2.html)) after a few failed iterations.", so I can't fully trust this assumption.
<img width="1696" height="60" alt="изображение" src="https://github.com/user-attachments/assets/640b665a-6e4d-4fa3-a594-d28286b1d404" />
Screenshot that confirms count of tets and workers number.
https://github.com/llvm/llvm-project/pull/194215
More information about the libcxx-commits
mailing list