Skip to content

Conversation

@ymolochkov
Copy link
Contributor

Substituted AtomicLong's for volatile long for several reasons:

  • I think it's not worth it to have almost the same visibility benefits with AtomicLong's and create unnecessary objects for them. Native locks and volatile fields should be sufficient here;
  • almost everywhere there are compound actions which require a separate synchronisation for themselves to be atomic, so AtomicLong's are overkill.

Also added necessary synchronisation in toString, copy and some other methods, since they we have reads over mutable variables.

Making iterator method synchronised is pointless, call to the iterator should be synced externally.

@ymolochkov ymolochkov closed this Jul 12, 2021
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

Successfully merging this pull request may close these issues.

1 participant