a post is not a text snippet - Slack has hidden that away under "Browse all shortcuts" unfortunately. but anyhow…
ephemient
01/26/2022, 9:08 PM
it is not safe to read from a map that is being updated concurrently
u
ubu
01/26/2022, 9:16 PM
do you mean that I should update getMethod or the whole paradigm (switching to actors, for instance)?
e
ephemient
01/26/2022, 9:17 PM
get() should also be synchronized on the same mutex
ephemient
01/26/2022, 9:19 PM
either that or use a different structure which is safe to access concurrently (Java has ConcurrentMap for example, but an actor publishing a whole new map on each update is also a possibility)