Skip to content
RED SAG Skills
hard20 pts · first answer countshash-mapconcurrencyjava

Race in check-then-put

Two threads run if (!map.containsKey(k)) map.put(k, createSession()) on a ConcurrentHashMap. Sometimes two sessions are created for one key. Why, and what fixes it?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions