I read the MSDN documentation but didn't really understand it.
I believe that the behavior of Set is "replace existing, or add" (atomically).
Is that correct?
I read the MSDN documentation but didn't really understand it.
I believe that the behavior of Set is "replace existing, or add" (atomically).
Is that correct?
Adddoes nothing (returnsfalse) if there is already a value for that key.Setdoes an insert or update, as necessary.Remove+Addwould leave a gap in the middle when another thread querying that key would get no clue (Setdoes not; the swap is typically atomic); as such, whileSethas the same end result asRemove+Add, the mechanism difference is important since it could impact other callers.For example of Add: