Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AtomicBuffer acquire/release methods #314

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pveentjer
Copy link
Contributor

@pveentjer pveentjer commented Jan 16, 2025

The AtomicBuffer has a replacement release method for every ordered method. So for e.g. a AtomicBuffer.putLongOrdered, there is a putLongRelease. The methods are identical, but the 'ordered' methods follow an old naming schema.

The ordered method will call the release method, so there is a slight performance penalty. This should encourage users to replace the ordered methods by the release methods.

Also acquire get methods have been added. Typically release puts are combined with acquire gets.

The new naming matches the naming in the Aeron C atomics (they also have acquire/release in the name). This makes it easier for engineers to compare Java and C code.

@pveentjer pveentjer requested a review from vyazelenko January 16, 2025 09:15
@pveentjer pveentjer force-pushed the feature/atomicbuffer-release-acquire branch from 4820472 to 15ede48 Compare January 16, 2025 09:18
The AtomicBuffer has release method for every ordered method. So for
e.g. a AtomicBUffer.putLongOrdered, there is a putLongRelease.

The ordered method will call the release version, so there is a sligth
performance penalty.

Also acquire get methods have been added that have slightly weaker
memory ordering semantics compared to a volatile read. Which could
provide more oppertunity for the JIT to do its magic and in theory
could give better performance on ISAs with weaker memory models.
@pveentjer pveentjer force-pushed the feature/atomicbuffer-release-acquire branch from 15ede48 to bb70d5d Compare January 16, 2025 09:20
@pveentjer pveentjer force-pushed the feature/atomicbuffer-release-acquire branch from 1df4f95 to 6876fcc Compare January 16, 2025 11:28
@pveentjer pveentjer force-pushed the feature/atomicbuffer-release-acquire branch from 6876fcc to 28c0419 Compare January 16, 2025 11:33
@pveentjer pveentjer changed the title [DONT MERGE] AtomicBuffer acquire/release operations. AtomicBuffer acquire/release operations. Jan 19, 2025
@pveentjer pveentjer changed the title AtomicBuffer acquire/release operations. AtomicBuffer acquire/release methods Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant