Priority inversion occurs when a high-priority thread waits for a resource held by a low-priority thread that cannot run because medium-priority threads take its processor; the high-priority thread is effectively demoted below the medium ones.
fetch_add, or into padded per-thread counters summed at the end. Only the design that shares nothing scales. Measured on a laptop (Intel Core Ultra 7 155H) under WSL2, no isolated cores, threads unpinned. Data: bench_lockfree.py.