Closed longjiquan closed 1 year ago
Version: antlr-4.9 Go Target Runtime: 20210826220005-b48c857c3a0e
I've also tried the newest version 4.13
, but the lexer and parser generated by the 4.13
are also not thread safe, since they will share the DFA. We already use the antlr in the production environment, so anyone can help me on this issue? Thanks in advance.
Please let me know if any other information is required.
They are go routine safe. This looks like your own action is not thread safe. Can you show me the actions you are using. Actions can usually be avoided, but I’d need to see your grammar
On Wed, Aug 30, 2023 at 13:44 Jiquan Long @.***> wrote:
Closed #4400 https://github.com/antlr/antlr4/issues/4400 as completed.
— Reply to this email directly, view it on GitHub https://github.com/antlr/antlr4/issues/4400#event-10228574603, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7TMADDFNKLJXAJVF5FRTXX3HMJANCNFSM6AAAAAA4D23MHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
As the above picture showed, when antlr trying to parse text under multiple thread, the access to global variable
str
makes the lexer not thread safe.