-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
[Ruby 2.3] Concurrency improvements to Queue/SizedQueue #3552
Closed
+8,067
−5,614
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This patch implements `Coverage.peek_result` that was implemented in MRI here: https://bugs.ruby-lang.org/issues/10816
…o tenderlove-peek_result
…e returned not obj
…ial_state argument [Feature #10958]
remove "initial_state" argument of Enumerable#{slice_before,chunk}
* master: (29 commits) [travis-ci] revert jdk 9 testing from 2fa04aa Eliminate Block.Type arg in BlockBody yield/call signatures Pass Block instead of Binding in BlockBody.yield/call Minor: fix typo in name of runtime helper instr method name Update to jnr-unixsocket 0.10. Improve CamelCase package splitting. Fixes jruby#3493. Update to jnr-unixsocket 0.10-SNAPSHOT for forFD. [Truffle] j+tr: support for passing any extra ruby options each_object(cls.singleton_class) should not walk special classes. This test has been moved to RubySpec. [Truffle] Typo. [Truffle] Tag failing regex specs. [Truffle] Tag failing Time.at spec. The bin200 distribution has grown in size. [Truffle] Fixed two typos of the same word on the same line of code. [Truffle] Simplified the fix in 5446cc2. [Truffle] Fixed an NPE when a SharedMethodInfo has a null argumentsDescriptors. [Truffle] Fixed the interpreter_path when the root JRuby distribution directory is not named "jruby." Fixes jruby#3483. define_method with empty body throws RuntimeError in interpreter Test main on Java 9 ...
[Ruby-2.3] - Implements Hash#fetch_values
* master: PushBindingInstr -> PushMethodBindingInstr Push/PopFrameInstr --> Push/PopMethodFrameInstr Change interpret sigs to distinguish between executing block and blockArg Rename block to blockArg in interpreter for clarity Remove one more line of code left behind that broke the build Remove changes to Block.java accidentally committed in 5e13527 Next step in refactoring block body signature for improved clarity Rename arguments in blockBody signatures for easier understanding [Truffle] findbugs: fix missing locale in toUpperCase [Truffle] code style [Truffle] fix Time#localtime
[Ruby-2.3] - Implements Enumerable#grep_v
[Ruby-2.3] - Implements Numeric#positive? and Numeric#negative?
[Ruby-2.3] - Implements Thread#name and Thread#name=
…oc sub-class also revert the protected block field in RubyProc introduced due previous hack as advised in jruby#2499
…ruby#3542) also did some internal cleanup e.g. private initialize now receive the runtime and added more asserts to go along with those from MRI's test_enumerator.rb
we're already passing Ruby 2.3 define_method without block behaviour
Queue impl is changing, so I'm isolating Fiber's use of it to a separate class to avoid volatility in Fiber logic.
MRI implements Queue and SizedQueue differently than we had been: * Implicitly locking around all operations, due to the GIL. * Notification of just those waiting to push for SizedQueue. In addition, the new #close method wakes up all threads waiting to pop or push, which was not easily done by wrapping JDK's LinkedBlockingQueue. This new impl is somewhat more in line with MRI, with regards to locking and notification. This locking will likely introduce some overhead compared to the old implementation, but the use of a simple ArrayList may balance that out somewhat. All tests in 2.3's thread/test_queue.rb pass now except for one relating to a a peculiarity in MRI's implementation: if you remove marshal_dump it falls back on Struct marshaling, since in MRI both Queue and SizedQueue are Structs. Ours are not Struct and I do not see a good reason to make them be so.
The implementation is now based on Doug Lea’s LinkedBlockingQueue. Concurrency wise, this is now dual locked (head/tail) linked queue, since Ruby std lib queues have blocking operations a completely lock-free queue is not practical endeavor.
Sorry, wrong branch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
The implementation is now based on Doug Lea’s LinkedBlockingQueue.
Concurrency wise, this is now dual locked (head/tail) linked queue,
since Ruby std lib queues have blocking operations a completely
lock-free queue is not practical endeavor.