Replies: 1 comment 3 replies
-
Hi,
Can you elaborate on this? If mutual exclusion is not guaranteed on the key, it is a bug. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@wvwwvwwv
So I have a situation where key A can be inserted into the map from different threads at the same time (a load on-demand flow), resulting in a collision.
What I want is the first thread to start the insertion to "lock" the key until its inserted, and the other threads to wait until the insertion is complete, to avoid multi-insert/collisions.
I thought that
HashMap::entry
would do this, but it doesn't seem to be the case. Is there a way to achieve this with scc? Or should I do the locking myself?Beta Was this translation helpful? Give feedback.
All reactions