Concurrent Dictionary AddOrUpdate vs Index Add

前端 未结 4 455
走了就别回头了
走了就别回头了 2021-02-03 21:06

There are two ways I\'ve assigned values to a existing key in a concurrent dictionary in my current project.

A. concurrentDictionary1[key] = value;

4条回答
  •  逝去的感伤
    2021-02-03 22:05

    Yes equivalent. No. indexers are actually methods (like properties are) and i dont think they bypass concurrency for that. method

提交回复
热议问题