Conversation
bff2040 to
3649f11
Compare
Like the official RE2 Python bindings, release the Ruby Global VM Lock when performing matches so work on other threads can continue. Note that Abseil's synchronization primitives (SRWLOCK and SleepConditionVariableSRW) are incompatible with Ruby's Win32 Mutex-based GVL, causing WAIT_ABANDONED crashes when multiple threads match concurrently so the GVL is _not_ released on Windows.
As with matching on RE2::Regexp objects, release the Ruby Global VM Lock when performing a match with a compiled RE2::Set object.
To prevent bugs when re-initializing an RE2::Regexp or RE2::Set during a match (especially now they can happen truly in parallel), freeze those objects as soon as possible (on initialization for RE2::Regexp and on compilation for RE2::Set). Similarly, freeze any input strings ASAP before subsequent coercions to prevent inputs being mutated before they are passed to the underlying RE2 library.
Following on from matching with RE2::Regexp and RE2::Set, release the Ruby Global VM Lock when performing a replace, global replace, or extract.
reinterpret_cast is more powerful than we need when casting void * to specific struct pointers.
This file contains hidden or 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
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.
Like the official RE2 Python bindings, release the Ruby Global VM Lock
when performing matches so work on other threads can continue.
Note that Abseil's synchronization primitives (SRWLOCK and
SleepConditionVariableSRW) are incompatible with Ruby's Win32
Mutex-based GVL, causing WAIT_ABANDONED crashes when multiple threads
match concurrently so the GVL is not released on Windows.