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

port NonBlockingHashMapLong from high-scale-lib #3560

Merged
merged 7 commits into from
Dec 28, 2015

Conversation

kares
Copy link
Member

@kares kares commented Dec 22, 2015

the high-scale lib has been added as a dependency fairly recently on 9K as well as 1.7.23
it was introduced to use NonBlockingHashMapLong as an alternative of IntHashMap (due #3394)

turns out that the library can not work without Unsafe (and thus broke Android support in 1.7.x see #3554) while JRuby allows to boot and run when sun.misc.Unsafe is not available. thus the proposal here is to port the NonBlockingHashMapLong over (the com.boundary:hish-scale-lib received no commit in more than a year) and tune it to be usable without Unsafe (fixing #3554)

this also resolves #3555 - packaging issue as .jar includes patch(es) of JDK class(es)

@kares kares changed the title port NonBlockingHashMapLong highscale 1 7 port NonBlockingHashMapLong from high-scale-lib Dec 22, 2015
@kares
Copy link
Member Author

kares commented Dec 22, 2015

if this looks like a good "resolution" please review the CAS fall-back semantics for arrays such as : 1624fd4#diff-0658ae080e35e981bf3e13528f2730c1R1398 ... if there's anything to be done better

@thedarkone
Copy link
Contributor

I'm just reviewing 1624fd4. IMO yes, your replacement is as correct as Cliff's original code.

PS: other potential reviewers: Cliff's cas isn't on the same volatile field that is used for read side sychronizes-with order.

PS2: admittedly, compared to cas, synchronized does provide compiler with more opportunities for mischievous reordering, but I don't think it matters with "current JITs".

@headius
Copy link
Member

headius commented Dec 28, 2015

Looks ok to me on a quick read-through, and I have faith in @thedarkone's judgment. Merging.

headius added a commit that referenced this pull request Dec 28, 2015
port NonBlockingHashMapLong from high-scale-lib
@headius headius merged commit 3b1f9eb into jruby-1_7 Dec 28, 2015
@kares kares deleted the test-port-highscale-1_7 branch December 28, 2015 05:17
@enebo enebo modified the milestone: Non-Release May 25, 2016
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.

None yet

4 participants