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

STNG-8 Use concurrent versions of HashMap, TreeMap, HashSet #193

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

jkosternl
Copy link
Collaborator

Use concurrent versions of HashMap, TreeMap, HashSet, and remove 2 obsolete synchronized keywords at EBL Surrender.

  • Note that 'synchronized' on a method does only synchronize threads on that particular method, not on all methods in the same class also changing the same maps!
  • EBL Surrender: Remove overridden methods, which just only call super (without it, it behaves the same)

Question: should I perform any extra verification on the correctness of our code, except for all the checks we've build in our GH pipelines already?

…te synchronized keywords at EBL Surrender.

* Note that 'synchronized' on a method does only synchronize threads on that particular method, not on all methods in the same class also changing the same maps!
* EBL Surrender: Remove overridden methods, which just only call super (without it, it behaves the same)
@jkosternl jkosternl self-assigned this Oct 14, 2024
@jkosternl jkosternl changed the title Use concurrent versions of HashMap, TreeMap, HashSet STNG-8 Use concurrent versions of HashMap, TreeMap, HashSet Oct 14, 2024
Copy link
Collaborator

@gj0dcsa gj0dcsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Please see internal Jira comment.]

Copy link
Collaborator

@gj0dcsa gj0dcsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let's discuss this before proceeding with the change, because "synchronized" was in place in the ActionPromptsQueue because most operations affect both collections in parallel.

private final LinkedList<JsonNode> pendingActions = new LinkedList<>();

synchronized void clear() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let's discuss this before proceeding with the change, because "synchronized" was in place because most operations affect both collections in parallel.

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.

2 participants