Is it possible to read AND write from a concurrent hashmap (in the same parallel job)?

Going to try a great idea to fix Are duplicate key value pairs possible in a nativemultihashmap? by @PublicEnumE

Thanks.

no, concurrent hash maps can’t be read from.

but tryadd returns bool to know if you have a collision

1 Like

Nice! So maybe I can use (key, value) from nativemultihashmap and use tryadd to a multihashmap to check for duplicate in nativemultihashmap?

Thank you so much for your help! TryAdd I think might be perfect here. Does TryAdd return false if the key is already assigned in the NativeHashmap?

I want to make sure, because if this is true, it will be perfect for my use case.

True if added, false if already exists

1 Like