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

remove some redundant fence #307

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

Conversation

hl845740757
Copy link
Contributor

@hl845740757 hl845740757 commented May 29, 2020

  1. For MpscLinkedArrayQueue, producer(producerLimit) rely on consumerIndex.
  2. For MpscLinkedArrayQueue, newBuffer is unreachable until soProducerIndex.
  3. For SpscLinkedArrayQueue, newBuffer is unreachable until soRefElement(JUMP).
  4. Fix resize assertion.
  5. For MpscUnboundedXaddArrayQueue, consumer free the chunk happens-before producer reuse the chunk.

I have run related tests.

@franz1981
Copy link
Collaborator

Please take a look at the LGTM error:

[2020-05-29 09:27:33] [autobuild] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project jctools-core: Compilation failure: Compilation failure: 
[2020-05-29 09:27:33] [autobuild] [ERROR] /opt/src/jctools-core/src/main/java/org/jctools/queues/atomic/BaseMpscLinkedAtomicArrayQueue.java:[791,9] method spRefElement in class org.jctools.queues.atomic.AtomicQueueUtil cannot be applied to given types;
[2020-05-29 09:27:33] [autobuild] [ERROR]   required: java.util.concurrent.atomic.AtomicReferenceArray<E>,int,E
[2020-05-29 09:27:33] [autobuild] [ERROR]   found: java.util.concurrent.atomic.AtomicReferenceArray<E>,int,java.util.concurrent.atomic.AtomicReferenceArray<E>
[2020-05-29 09:27:33] [autobuild] [ERROR]   reason: inferred type does not conform to lower bound(s)
[2020-05-29 09:27:33] [autobuild] [ERROR]     inferred: E
[2020-05-29 09:27:33] [autobuild] [ERROR]     lower bound(s): java.util.concurrent.atomic.AtomicReferenceArray<E>
[2020-05-29 09:27:33] [autobuild] [ERROR] /opt/src/jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java:[247,9] method spRefElement in class org.jctools.queues.atomic.AtomicQueueUtil cannot be applied to given types;
[2020-05-29 09:27:33] [autobuild] [ERROR]   required: java.util.concurrent.atomic.AtomicReferenceArray<E>,int,E
[2020-05-29 09:27:33] [autobuild] [ERROR]   found: java.util.concurrent.atomic.AtomicReferenceArray<E>,int,java.util.concurrent.atomic.AtomicReferenceArray<E>
[2020-05-29 09:27:33] [autobuild] [ERROR]   reason: inferred type does not conform to lower bound(s)
[2020-05-29 09:27:33] [autobuild] [ERROR]     inferred: E
[2020-05-29 09:27:33] [autobuild] [ERROR]     lower bound(s): java.util.concurrent.atomic.AtomicReferenceArray<E>
[2020-05-29 09:27:33] [autobuild] [ERROR] -> [Help 1]

@hl845740757
Copy link
Contributor Author

@franz1981 fixed

@coveralls
Copy link

coveralls commented May 29, 2020

Pull Request Test Coverage Report for Build 683

  • 37 of 39 (94.87%) changed or added relevant lines in 6 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.2%) to 86.114%

Changes Missing Coverage Covered Lines Changed/Added Lines %
jctools-core/src/main/java/org/jctools/queues/MpscUnboundedXaddArrayQueue.java 2 3 66.67%
jctools-core/src/main/java/org/jctools/queues/atomic/BaseMpscLinkedAtomicArrayQueue.java 8 9 88.89%
Files with Coverage Reduction New Missed Lines %
jctools-core/src/main/java/org/jctools/maps/NonBlockingHashMap.java 1 79.26%
jctools-core/src/main/java/org/jctools/maps/NonBlockingHashMapLong.java 2 80.4%
jctools-core/src/main/java/org/jctools/maps/NonBlockingIdentityHashMap.java 3 76.81%
Totals Coverage Status
Change from base Build 676: 0.2%
Covered Lines: 4775
Relevant Lines: 5545

💛 - Coveralls

@nitsanw
Copy link
Contributor

nitsanw commented May 30, 2020 via email

@hl845740757
Copy link
Contributor Author

@nitsanw Sorry, I forgot to run mvn build...

@hl845740757
Copy link
Contributor Author

JCTools is a great library.
I have read the source code of all queues and will not submit new issues or prs in a short time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants