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

Fixes #284 Add support for Thread.onSpinWait() while spinning #285

Open
wants to merge 79 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
3322e9f
Save producerIndex load while polling a pooled chunk on mpmc xadd q
franz1981 Nov 5, 2019
02238cb
Fix LGTM warnings (though no bug suspected)
nitsanw Nov 6, 2019
03ea923
mpsc xadd q relaxedPeek cannot assume element presence
franz1981 Nov 6, 2019
bfaa2da
Add fill test
nitsanw Nov 6, 2019
e5da44d
Fix argument checks on `fill(s,limit)`, add tests
nitsanw Nov 6, 2019
7ed5d31
Fix harmless LGTM warning
nitsanw Nov 6, 2019
f9a09d8
Fix LGTM warning, and buffer sizing overflow bug (in experimental code)
nitsanw Nov 6, 2019
7e4eb24
Fix LGTM warning (harmless)
nitsanw Nov 6, 2019
b467d29
Fix LGTM warning, potential int overflow bug
nitsanw Nov 6, 2019
15d944c
Fix LGTM warning, potential int overflow bug
nitsanw Nov 6, 2019
6367951
Fix LGTM warning, potential int overflow bug
nitsanw Nov 6, 2019
b70e83e
Fix LGTM warning, useless condition(always true)
nitsanw Nov 6, 2019
e215fbe
Fix LGTM warning, harmless
nitsanw Nov 6, 2019
7878ab5
Fix LGTM warning, remove pointless conditional (always false)
nitsanw Nov 6, 2019
172a2f8
Fix LGTM warning, harmless
nitsanw Nov 6, 2019
c8676da
Fix LGTM warning, wrong param name
nitsanw Nov 6, 2019
d751cda
Add LGTM badge
nitsanw Nov 6, 2019
78965db
Standardize on arg checking for `fill` methods + tests
nitsanw Nov 6, 2019
6f88bf5
Standardize on `soElement` for nulling. Fix #252
nitsanw Nov 6, 2019
66e71af
Fixes #272 BurstCost aren't handling multi-consumers correctly
franz1981 Nov 16, 2019
2bac336
Unified multi with single-consumer handling and saved XADD handling
franz1981 Nov 17, 2019
801d793
Clarify javadoc on batch methods usage and assumptions.
nitsanw Nov 18, 2019
df2ca51
Add fill implementations to reduce code dup. Check drain params.
nitsanw Nov 18, 2019
d07783a
Add MPQUtil import
nitsanw Nov 18, 2019
58d8c95
Use standard drain/fill, add drain param checks + tests
nitsanw Nov 18, 2019
65ec59c
Add fill test for unbounded case and some standard way to implement
nitsanw Nov 18, 2019
a4125a7
Addressing Event false-sharing and qCapacity as a String config property
franz1981 Nov 18, 2019
15b12a1
Clarify javadoc for linked queue, touch up MPQ javadoc
nitsanw Nov 21, 2019
b86a84a
Added start latch to ensure consumers are ready before offering
franz1981 Nov 25, 2019
9c354ce
Merge pull request #273 from franz1981/mc_burst_bench
nitsanw Nov 25, 2019
31752ec
Merge pull request #270 from franz1981/relaxed_peek
nitsanw Nov 25, 2019
b178dfd
Merge pull request #269 from franz1981/mpmc_xadd_poll
nitsanw Nov 25, 2019
78ecf5a
Clarify javadoc for linked queue
nitsanw Dec 7, 2019
543ea11
Add QueueProgressIndicators minimal test
nitsanw Dec 7, 2019
94a1f3c
Remove needless `final` modifier
nitsanw Dec 20, 2019
3bedbf6
Remove needless `final` modifier
nitsanw Dec 20, 2019
f69aa2f
Reduce indirection and remove unused helpers
nitsanw Dec 20, 2019
5a20fbb
Reduce indirection and remove unused helpers
nitsanw Dec 20, 2019
01f27bc
Should not use Objects (since 1.7)
nitsanw Dec 20, 2019
d8e0e1c
Whitespace
nitsanw Dec 20, 2019
618dc8b
Iterators implementations should not rely on default methods
nitsanw Dec 20, 2019
0860097
Fix #277 Improve BaseMpscLinkedArrayQueue iterator
nitsanw Dec 21, 2019
14250a5
wait-free relaxedPoll for mpmc xadd q (#276)
franz1981 Dec 21, 2019
0790a2b
Refactor for clarity and split out an XADD qualification
nitsanw Dec 23, 2019
62311fc
Javadoc cleanup
nitsanw Dec 23, 2019
54620a4
Drop seq array false sharing padding (MpmcArrayQueue)
nitsanw Dec 23, 2019
4eaa9f2
Refactor out the Unsafe long[] access common parts
nitsanw Dec 23, 2019
11189ca
Extract chunks to files + formatting/refactoring
nitsanw Dec 23, 2019
f2213bd
Rename ref array accessors and fallout
nitsanw Dec 23, 2019
cff1522
Refactoring, adding doc, reading through tweaks
nitsanw Dec 24, 2019
710bc7e
Incremented the tests on the mpsc xadd q + fixed comment (#278)
franz1981 Dec 25, 2019
c5702b1
Add a no-recycling test for the xadd queues
nitsanw Dec 27, 2019
614a6f0
Deprecate QueueFactory and the spec package
nitsanw Dec 27, 2019
054ff25
Reduce visibility of internal class
nitsanw Dec 27, 2019
f1cc3d4
Reduce visibility of internal class
nitsanw Dec 27, 2019
3de1ad2
Reduce visibility of internal class
nitsanw Dec 27, 2019
e5c80a5
Cleanup javadoc and comments
nitsanw Dec 27, 2019
a499fb8
Cleanup doc
nitsanw Dec 27, 2019
7d68e3f
Cleanup doc
nitsanw Dec 27, 2019
8497896
Add license
nitsanw Dec 30, 2019
fcf208d
Add license
nitsanw Dec 30, 2019
2b35474
Cleanup imports
nitsanw Dec 30, 2019
36c352b
Add license
nitsanw Dec 30, 2019
13cb48a
Improved naming, make relaxedPoll more relaxed
nitsanw Dec 30, 2019
9ae6192
Refactoring
nitsanw Dec 30, 2019
6ffb079
Reduce code duplication in xadd code
nitsanw Dec 30, 2019
a9610d1
cleanup constant usage
nitsanw Dec 30, 2019
32603ab
Fix broken interaction with moveToNextConsumerChunk
nitsanw Dec 30, 2019
e8aa714
Reinstate author lost in refactoring
nitsanw Dec 30, 2019
982dc51
Do not pool first chunk is maxPooledChunks is 0
nitsanw Dec 30, 2019
2cfcda9
Added new test cases + changed some bits of logic 4 xadd qs
franz1981 Dec 31, 2019
264e669
Allow conc test length config
nitsanw Dec 31, 2019
cf35ee3
mpmc xadd q poll wasn't handling correctly chunkSize = 1 pooled case …
franz1981 Jan 2, 2020
c6836e8
mpmc xadd q poll docs + clearing up names (#282)
franz1981 Jan 3, 2020
0a8028b
Remove empty lines
nitsanw Jan 3, 2020
e6371aa
Fix comment after rename
nitsanw Jan 3, 2020
cece8fc
Update version and release notes
nitsanw Jan 3, 2020
c860b66
Update version
nitsanw Jan 3, 2020
6ecf6b9
Fixes #284 Add support for Thread.onSpinWait() while spinning
franz1981 Jan 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[![Coverage Status](https://coveralls.io/repos/github/JCTools/JCTools/badge.svg?branch=master)](https://coveralls.io/github/JCTools/JCTools?branch=master) [![Build Status](https://travis-ci.org/JCTools/JCTools.svg?branch=master)](https://travis-ci.org/JCTools/JCTools) [![Gitter](https://badges.gitter.im/JCTools/JCTools.svg)](https://gitter.im/JCTools/JCTools?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/JCTools/JCTools.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/JCTools/JCTools/alerts/)
[![Coverage Status](https://coveralls.io/repos/github/JCTools/JCTools/badge.svg?branch=master)](https://coveralls.io/github/JCTools/JCTools?branch=master)
[![Build Status](https://travis-ci.org/JCTools/JCTools.svg?branch=master)](https://travis-ci.org/JCTools/JCTools)
[![Gitter](https://badges.gitter.im/JCTools/JCTools.svg)](https://gitter.im/JCTools/JCTools?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

JCTools
==========
Expand All @@ -18,7 +21,8 @@ the JDK:

There's more to come and contributions/suggestions are most welcome. JCTools has enjoyed support from the community
and contributions in the form of issues/tests/documentation/code have helped it grow.
JCTools offers excellent performance at a reasonable price (FREE! under the Apache 2.0 License). It's stable and in use by such distinguished frameworks as Netty, RxJava and others. JCTools is also used by commercial products to great result.
JCTools offers excellent performance at a reasonable price (FREE! under the Apache 2.0 License). It's stable and in
use by such distinguished frameworks as Netty, RxJava and others. JCTools is also used by commercial products to great result.

Get it NOW!
==========
Expand All @@ -27,7 +31,7 @@ Add the latest version as a dependency using Maven:
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-core</artifactId>
<version>2.1.1</version>
<version>3.0.0</version>
</dependency>
```

Expand All @@ -44,11 +48,11 @@ And setup the following dependency:
<dependency>
<groupId>com.github.JCTools.JCTools</groupId>
<artifactId>jctools-core</artifactId>
<version>v2.1.1</version>
<version>v3.0.0</version>
</dependency>
```

You can also depend on latest snapshot from this repository (live on the edge) by setting the version to '2.2-SNAPSHOT'.
You can also depend on latest snapshot from this repository (live on the edge) by setting the version to '3.0.1-SNAPSHOT'.


Build it from source
Expand Down
30 changes: 30 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
3.0.0
=========
This is a major version as there are some minor API breaking changes which may effect users. Please apply with care and provide feedback. The breaking changes:

Removed MpscLinkedQueue7 and MpscLinkedQueue8 and consolidate into parent. This removes the need for the builder method on MpscLinkedQueue.
Deprecated QueueFactory and spec package classes. These are not used by any users AFAICT and are only used for testing internally.
Removed some internal classes and reduced visibility of internal utilities where practical. The @InternalAPI tagging annotation is also used more extensively to discourage dependency.
We also have some great new queues for y'all to try:
- #226: XADD unbounded mpsc/mpmc queue: highly scalable linked array queues
(from @franz1981)
- New blocking consumer MPSC (with contributions and bug fixes from @njhill)

Bug fixes:
- #209: On Arm7, non-volatile long can have unaligned address leading to error
- #216: Size of SpscGrowableArrayQueue can exceeds max capacity (from @franz1981 PR #218)
- #241: Protect the producer index in case of OutOfMemoryError (from @franz1981)
- #244: Long NBHM AssertionError when replacing missing key (thanks @fvlad for reporting and @cliffclick for assistance and review)
- Fix argument checks on fill/drain methods
- Fix LGTM warning, potential int overflow bug b467d29, 15d944c, 6367951

Improvements:
- Don't mark generated linked atomic queues as final (from @kay 9db418c)
- #211: Implement batching methods on MpmcArrayQueue (from @franz1981)
- #228: Iterator for MpscArrayQueue and MpscUnboundedArrayQueue (PR #229 from @srdo)
- Iterator support also available for the *ArrayQueue classes
- #208: MpscLinkedAtomicQueue can be made not final
- #237: Add scale to exception message to help debug netty/netty#8916 (from @johnou)

Many other improvements to testing, javadoc, formatting were made with some contributions from @Hearen @JanStureNielsen @nastra thanks!

2.1.2
=========
- PR #202 : Fix NBHM bug in remove/replace where ref equality was used to report val match instead of equals (thanks @henri-tremblay)
Expand Down
2 changes: 1 addition & 1 deletion jctools-benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jctools</groupId>
<artifactId>jctools-parent</artifactId>
<version>3.0-SNAPSHOT</version>
<version>3.0.1-SNAPSHOT</version>
</parent>

<artifactId>jctools-benchmarks</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

/**
* Measure cost of offer/poll on single thread.
*
*
* @author nitsanw
*
*
*/
@State(Scope.Thread)
@BenchmarkMode(Mode.AverageTime)
Expand All @@ -39,7 +39,7 @@ public class QueueOfferPoll {
@Param(value = "1")
int burstSize;
Queue<Integer> q;

@Setup(Level.Trial)
public void createQ() {
q = QueueByTypeFactory.createQueue(qType, qCapacity);
Expand All @@ -51,7 +51,7 @@ public int offerAndPollLoops() {
for (int i = 0; i < burstSize; i++) {
q.offer(DUMMY_MESSAGE);
}
Integer result = null;
Integer result = DUMMY_MESSAGE;
for (int i = 0; i < burstSize; i++) {
result = q.poll();
}
Expand Down