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

Note that this library is not thread safe #39

Closed
ScottPeterJohnson opened this issue Mar 8, 2021 · 1 comment
Closed

Note that this library is not thread safe #39

ScottPeterJohnson opened this issue Mar 8, 2021 · 1 comment

Comments

@ScottPeterJohnson
Copy link

In grammars on the JVM, RegexTokens (at least) use stateful matchers, and therefore aren't thread-safe. It would be nice if the library either noted this, or was thread-safe (by creating a new matcher as needed- at a glance this doesn't seem to be an expensive JVM operation, I think that's the creation of the Pattern).

@h0tk3y
Copy link
Owner

h0tk3y commented Mar 17, 2021

Thanks for noticing this! I think using ThreadLocal matches would make sense and would make the JVM implementation thread-safe. I'll fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants