Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make APC updateGauge with set command lock-free in critical path
When setting a value on a gauge, apcu_store is always called two times, taking a write lock each that can cause contention. - Replace apcu_store with compare-and-swap algorithm unless we store for the first time(s) - Eagerly fetch old value instead of apcu_exists, since we will anyway need it for the compare-and-swap algorithms that follows, saving one call to APCu - Make sure we never enter an infinite loop in the compare-and-swap section by falling back to a first-time insert if $old === false. A fix for the potential infinite loop below will be done in a separate commit. Signed-off-by: Tobias Bengtsson <[email protected]>
- Loading branch information