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

Use atomic instead of a shared mutex for DFA.s0 #3313

Merged
merged 1 commit into from
Dec 28, 2021

Conversation

jcking
Copy link
Collaborator

@jcking jcking commented Oct 18, 2021

A shared mutex is kind of heavyweight when we are essentially replicating volatile from Java which is ultimately an atomic load/store. This change switches Go to use the equivalent, atomic.StorePointer and atomic.LoadPointer.

@parrt
Copy link
Member

parrt commented Dec 28, 2021

that sounds right to me as we did very little locking in java version. Particularly when all we did was switch a pointer.

@parrt parrt modified the milestones: 4.9, 4.9.4 Dec 28, 2021
@parrt parrt merged commit 8fabd86 into antlr:master Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants