Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
K
KWSys
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
  • Merge Requests 0
    • Merge Requests 0
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • Utils
  • KWSys
  • Merge Requests
  • !72

Merged
Created Dec 04, 2017 by Sebastian Holtermann@sebholtContributor

Make RegularExpression reentrant (thread safe)

  • Overview 9
  • Commits 4
  • Pipelines 4
  • Changes 2

RegularExpression used global variables shared by every instance. This made it impossible to use it concurrently even with independent instances.

By moving the once shared variables into a class on the stack RegularExpression becomes reentrant. That means that separate instances of RegularExpression can be used concurrently in different threads.

Additionally there is a new RegularExpressionMatch class that can be passed to a new two-argument RegularExpression::find() method. The new method is thread safe when used with separate RegularExpressionMatch instances. This allows to use the find() method of a single RegularExpression instance concurrently on different strings with independent RegularExpressionMatch results.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: regular-expression-thread-safe