Bug 50586 - atomics fail on (SMP) PPC machines
Summary: atomics fail on (SMP) PPC machines
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: Other Linux
: P2 critical (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
Depends on:
Reported: 2011-01-14 09:47 UTC by Thomas Köckerbauer
Modified: 2021-10-12 06:19 UTC (History)
1 user (show)

(SMP) PPC atomics patch (9.41 KB, patch)
2011-01-14 09:47 UTC, Thomas Köckerbauer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Köckerbauer 2011-01-14 09:47:11 UTC
Created attachment 26489 [details]
(SMP) PPC atomics patch

The current PPC atomics code does not work reliable for SMP machines - our locks implemented using apr_atomic_cas32 and apr_atomic_set32 did fail on those machines.

There are additional sync instructions necessary since the write order of the store instructions is not guaranteed on PowerPC.

The same applies when the gcc-builtin atomics are used on PPC: For atomic set and get there are additional sync instructions necessary, since the write order is not guaranteed volatile is not enough.