RFR: 8307926: Support byte-sized atomic bitset operations [v2]

David Holmes dholmes at openjdk.org
Tue May 16 05:18:55 UTC 2023


On Sat, 13 May 2023 23:08:59 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Please review this change to add support Atomic byte-sized bitset operations.
>> The existing default implementation using cmpxchg already (by accident) works
>> on such values, because cmpxchg supports byte-sized operations.  Any future
>> platform specializations of these operations will need to deal with this size
>> too.
>> 
>> The changes consist of updating the requirements documentation for the
>> operations and adding gtests for the newly supported size.
>> 
>> Testing:
>> mach5 tier1-3
>> GHA testing
>
> Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge branch 'master' into atomic-bitops-bytes
>  - support bitops on bytes

Sorry but I don't see how this can work in general for byte. Yes you can update an individual byte as part of a CAS, but on some platforms the address may need to be aligned to 32-bit boundary. It also requires that the byte to be updated is surrounded by other writeable bytes, and that byte-tearing is not an issue. ???

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13952#issuecomment-1549003907


More information about the hotspot-runtime-dev mailing list