I keep in memory HashMap, which stores a list testUserIdsfor my own emailId.
HashMap<Integer, String> testUsers = new HashMap<>()
And there is only one background thread that reads additions / deletions to the list testUsersand performs operations on this map. Since there is only one thread on this card, I don’t have to make it a synchronized card.
But there are several streams on this map. Do I need ConcurrentHashMapif there is only one writer, but several readers?
source
share